fix dsfull
authorIan Kelling <ian@iankelling.org>
Fri, 2 Sep 2016 11:06:08 +0000 (04:06 -0700)
committerIan Kelling <ian@iankelling.org>
Mon, 6 Feb 2017 06:21:41 +0000 (22:21 -0800)
dsfull

diff --git a/dsfull b/dsfull
index 1fea3bce6a7b4cf49464a9715d8a73d1b0d39e1f..a8a2f1ff3611334775bcc365726c580bd201bfbb 100755 (executable)
--- 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