#!/bin/bash # # force a user interruption even if fai detected no error and no reboot/halt # flag was specified (otherwise fai happily reboots) # # $flag_halt & $flag_reboot are used in the original hook, but not # available to us -> parse FAI_FLAGS manually # FAI_FLAGS may contain something like 'sshd createvt reboot' flag_halt=0 flag_reboot=0 for flag in $FAI_FLAGS ; do case $flag in 'halt') flag_halt=1 ;; 'reboot') flag_reboot=1 ;; # ignore all other flags esac done # wait if no action was defined if [ "$flag_halt" -eq 0 ] && [ "$flag_reboot" -eq 0 ] ; then echo "FAI flags did not contain [reboot|halt]. Press a key to continue." echo "(If you press a 'dead' key then you are not as funny as you think you are.)" read fi