2 # Copyright (C) 2016 Ian Kelling
4 # distro setup full using fai. (assuming we already synced data files to the host)
8 trap 'cleanup; echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
11 if [[ $1 == -r ]]; then
18 if [[ ! $host ||
$host == -h ]]; then
19 echo "$0: error: expected 1 arg of hostname"
25 cleanup
() { pxe-server
:; }
30 # untested, this caused hang using here doc.
31 ssh $host "touch /tmp/keyscript-off; sudo reboot" ||
: &
38 for ((i
=0; i
<240; i
++)); do
39 if timeout
-s 9 10 ssh $host :; then
46 echo "$0: error: timeout"