From 3f56de1355036e471f3c82c44935a585879d3b20 Mon Sep 17 00:00:00 2001 From: John Van de Meulebrouck Brendgard Date: Wed, 13 Feb 2019 15:46:57 +0100 Subject: [PATCH] Force pseudo-terminal when running addhost so that addhost also works on Debian (also contains another small sync with nunoc-ops). --- addhost | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/addhost b/addhost index 1c34ce3..f8cbe64 100755 --- a/addhost +++ b/addhost @@ -37,6 +37,11 @@ defrepo=`git remote -v | grep ${remote:="ro"} | grep fetch | awk '{print $2}'` rrepo=${repo:="$defrepo"} rtag=${tag:="changeme"} +if [ "x$rrepo" = "x" ]; then + echo "$0: repo not set in cosmos.conf and no git remote named 'ro' found" + exit 1 +fi + if [ ! -d $cmd_hostname ]; then cp -pr default $cmd_fqdn git add $cmd_fqdn @@ -46,7 +51,7 @@ fi if [ "$cmd_do_bootstrap" = "yes" ]; then scp apt/cosmos_1.5-1_all.deb apt/bootstrap-cosmos.sh root@$cmd_hostname: - ssh root@$cmd_hostname ./bootstrap-cosmos.sh $cmd_fqdn $rrepo $rtag - ssh root@$cmd_hostname cosmos update - ssh root@$cmd_hostname cosmos apply + ssh -t root@$cmd_hostname ./bootstrap-cosmos.sh $cmd_fqdn $rrepo $rtag + ssh -t root@$cmd_hostname cosmos update + ssh -t root@$cmd_hostname cosmos apply fi