deployment: support ngcpreboot option to reboot after deployment

This is needed for the automated PRO deployment via tftp/netscript/...

From: Michael Prokop <mprokop@sipwise.com>
ksolomko/vlan
Michael Prokop 14 years ago
parent 24a121d935
commit 9e4aa6ad61

@ -52,6 +52,7 @@ TRUNK_VERSION=false
DEBIAN_RELEASE=squeeze
KANTAN=false
HALT=false
REBOOT=false
if [ -L /sys/block/vda ] ; then
export DISK=vda # will be configured as /dev/vda
else
@ -292,6 +293,10 @@ fi
if checkBootParam ngcphalt ; then
HALT=true
fi
if checkBootParam ngcpreboot ; then
REBOOT=true
fi
## }}}
## interactive mode {{{
@ -373,6 +378,7 @@ for param in $* ; do
*ngcpnobonding*) BONDING=false;;
*ngcpbonding*) BONDING=true;;
*ngcphalt*) HALT=true;;
*ngcpreboot*) REBOOT=true;;
esac
shift
done
@ -1418,6 +1424,14 @@ echo
logit "Successfully finished deployment process [$(date) - running ${SECONDS} seconds]"
echo "Successfully finished deployment process [$(date) - running ${SECONDS} seconds]"
if "$REBOOT" ; then
echo "Rebooting system as requested via ngcpreboot"
for key in s u b ; do
echo $key > /proc/sysrq-trigger
sleep 2
done
fi
# do not prompt when running inside kantan
if "$KANTAN" ; then
if [[ "$SHLVL" == "2" ]] || [ -n "${NETSCRIPT:-}" ] ; then

Loading…
Cancel
Save