Skip to content
Snippets Groups Projects
Verified Commit eff5ff4e authored by David Beniamine's avatar David Beniamine
Browse files

Small improvements

parent 1d5b1ee7
No related branches found
No related tags found
No related merge requests found
...@@ -22,13 +22,16 @@ getip(){ ...@@ -22,13 +22,16 @@ getip(){
} }
runcmd(){ runcmd(){
ssh root@$1 $2 host=$1
shift
echo "Runnig $@ on $host"
ssh root@$host $@
} }
conf_dir="/etc/registry" conf_dir="/etc/registry"
conf_file="$conf_dir/hosts" conf_file="$conf_dir/hosts"
broadcast=$(ip a | awk '/inet.*eth1/ {print $4}' | cut -d / -f 1) broadcast=$(ip a | awk '/inet.*eth1/ {print $4}' | cut -d / -f 1)
wait_time=300 wait_time=10
wait_step=5 wait_step=5
if [ -z "$1" ] if [ -z "$1" ]
...@@ -47,15 +50,16 @@ done < $conf_file ...@@ -47,15 +50,16 @@ done < $conf_file
# Wait for boot # Wait for boot
echo "" echo ""
while [ $wait_time > 0 ] while [ $wait_time -gt 0 ]
do do
echo -ne "Waiting for boot, remaining $wait_time seconds\r" echo -ne "Waiting for boot, remaining $wait_time seconds\r"
sleep $wait_step sleep $wait_step
wait_time=$(($wait_time - $wait_step)) wait_time=$(($wait_time - $wait_step))
done done
echo -e "\nWaiting finished"
for mac in $MACS for mac in $MACS
do do
ip=$(getip $mac) ip=$(getip $mac)
run_cmd $ip $cmd & runcmd $ip $cmd &
done done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment