From b4a1cdceaab87fb22822feeb11f35fc06ccab3fe Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Tue, 6 Nov 2018 14:02:27 -0800 Subject: [PATCH] Add timeout to prevent a stuck ssh --- net/gce.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/gce.sh b/net/gce.sh index 4c440b1474..3c3321b42a 100755 --- a/net/gce.sh +++ b/net/gce.sh @@ -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