- regex=".*DHCPACK.*$host_regex$"
- i=0
- tmp=$(mktemp)
- while (( i != 2 )) && read line; do
- if [[ $line =~ $regex ]]; then
- i=$((i+1))
- echo $line
- fi
- done < <(ssh wrt logread -f)
- sv sleep 5
- sv "$BASH_SOURCE" :
+ m myfai-chboot ${chboot_args[@]} $host
+ else
+ # This will fail if faiserver is not setup, so ignore any
+ # failure and don't bother us about it.
+ m myfai-chboot &>/dev/null ||:
+ fi
+fi
+
+if $wait; then
+ # fai's debian jessie 8.5ish does 2 dhcp requests when booting,
+ # roughly 4 seconds apart. Earlier
+ # versions did just 1. Now testing on a vm, it does 1.
+ # bleh.
+ echo "waiting for $acks dhcp acks then disabling pxe"
+ ack-wait $acks
+ type=
+ unset cmd
+ set-pxe
+
+ # previously tried waiting for one more ack then disabling faiserver,
+ # since it can contain sensitive info, so turn it off when not in use,
+ # but disabling that for now as it's inconvenient to clean this
+ # up and run it in the background etc.
+
+ # if [[ $type == fai ]]; then
+ # echo "waiting for 1 dhcp ack then disabling fai server"
+ # ack-wait 1
+ # faiserver-disable
+ # fi