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