diff --git a/registry/scripts/upgrade_all.sh b/registry/scripts/upgrade_all.sh index db5cec798d4df65812ca90207aa37c12432a672c..1b567c93479486e8e09317acd6931fd214087a88 100755 --- a/registry/scripts/upgrade_all.sh +++ b/registry/scripts/upgrade_all.sh @@ -22,13 +22,16 @@ getip(){ } runcmd(){ - ssh root@$1 $2 + host=$1 + shift + echo "Runnig $@ on $host" + ssh root@$host $@ } conf_dir="/etc/registry" conf_file="$conf_dir/hosts" broadcast=$(ip a | awk '/inet.*eth1/ {print $4}' | cut -d / -f 1) -wait_time=300 +wait_time=10 wait_step=5 if [ -z "$1" ] @@ -47,15 +50,16 @@ done < $conf_file # Wait for boot echo "" -while [ $wait_time > 0 ] +while [ $wait_time -gt 0 ] do echo -ne "Waiting for boot, remaining $wait_time seconds\r" sleep $wait_step wait_time=$(($wait_time - $wait_step)) done +echo -e "\nWaiting finished" for mac in $MACS do ip=$(getip $mac) - run_cmd $ip $cmd & + runcmd $ip $cmd & done