Add timeout to prevent a stuck ssh

This commit is contained in:
Michael Vines
2018-11-06 14:02:27 -08:00
parent b250d20059
commit b4a1cdceaa

View File

@ -207,7 +207,7 @@ EOF
echo "Waiting for $name to finish booting..."
(
for i in $(seq 1 30); do
if (set -x; ssh "${sshOptions[@]}" "$publicIp" "test -f /.instance-startup-complete"); then
if (set -x; timeout 20s ssh "${sshOptions[@]}" "$publicIp" "test -f /.instance-startup-complete"); then
break
fi
sleep 2