From 46edfde8e1fbb4121d5d0661946fc419d042543d Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Fri, 2 Sep 2016 04:06:08 -0700 Subject: [PATCH] fix dsfull --- dsfull | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/dsfull b/dsfull index 1fea3bc..a8a2f1f 100755 --- a/dsfull +++ b/dsfull @@ -21,24 +21,28 @@ if [[ ! $host || $host == -h ]]; then fi set -x + +cleanup() { pxe-server :; } +pxe-server fai $host + + if $reboot; then # untested, this caused hang using here doc. - ssh $host "touch /tmp/keyscript-off; sudo reboot" ||: + ssh $host "touch /tmp/keyscript-off; sudo reboot" ||: & fi -cleanup() { pxe-server :; } -pxe-server -a fai $host +pxe-server -a : cleanup() { :; } -timedout=true +error=true for ((i=0; i<240; i++)); do if timeout -s 9 10 ssh $host :; then - timedout=false + error=false break fi sleep 5 done -if $timeout; then +if $error; then echo "$0: error: timeout" exit 1 fi -- 2.30.2