iankelling.org
/
git
/
automated-distro-installer
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
better support for systems with no pxe
[automated-distro-installer]
/
dsfull
diff --git
a/dsfull
b/dsfull
index 1fea3bce6a7b4cf49464a9715d8a73d1b0d39e1f..51ecdda5013c6101e788d5f31383f4b900d4c691 100755
(executable)
--- a/
dsfull
+++ b/
dsfull
@@
-2,6
+2,9
@@
# Copyright (C) 2016 Ian Kelling
# distro setup full using fai. (assuming we already synced data files to the host)
# Copyright (C) 2016 Ian Kelling
# distro setup full using fai. (assuming we already synced data files to the host)
+# Usage: dsfull [-r] HOST
+# -r for no reboot.
+
set -eE -o pipefail
cleanup() { :; }
set -eE -o pipefail
cleanup() { :; }
@@
-21,24
+24,28
@@
if [[ ! $host || $host == -h ]]; then
fi
set -x
fi
set -x
+
+cleanup() { pxe-server :; }
+pxe-server $host fai
+
+
if $reboot; then
# untested, this caused hang using here doc.
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
fi
-cleanup() { pxe-server :; }
-pxe-server -a fai $host
+pxe-server -a
cleanup() { :; }
cleanup() { :; }
-
timedout
=true
+
error
=true
for ((i=0; i<240; i++)); do
if timeout -s 9 10 ssh $host :; then
for ((i=0; i<240; i++)); do
if timeout -s 9 10 ssh $host :; then
-
timedout
=false
+
error
=false
break
fi
sleep 5
done
break
fi
sleep 5
done
-if $
timeout
; then
+if $
error
; then
echo "$0: error: timeout"
exit 1
fi
echo "$0: error: timeout"
exit 1
fi