From 6aac096c77e5840a3b6649a117323c47dfbd8b58 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 856813bc11..435435ff7f 100755 --- a/net/gce.sh +++ b/net/gce.sh @@ -219,7 +219,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