[svlug] Confirm CTRL-ALT-DEL before rebooting
Robert Hajime Lanning
lanning at lanning.cc
Tue Sep 7 19:36:26 PDT 2004
<quote who="Mark">
> ca::ctrlaltdel:/usr/local/sbin/confirmed_reboot
You could use:
ca::ctrlaltdel:/usr/local/sbin/confirmed_reboot < /dev/tty12 > \
/dev/tty12 2> /dev/tty12
Then:
> ----------------------------------------------------
chvt 12
> expected_string='ReBoOt';
> prompt="\nEnter '$expected_string' (case-sensitive) followed by
> <ENTER> to
> reboot machine.\nHit <CTRL>-C to cancel and c
> ontinue.\n"
> read -t 10 -p "$prompt" reply
> if [ "$reply" == "$expected_string" ]; then
> echo "\nRebooting...\n"
> #/sbin/shutdown -t3 -r now
> else
> echo "\nWrong confirmation, not rebooting.\n"
> fi
> ----------------------------------------------------
Just make sure you have nothing running on virtual console 12.
--
END OF LINE
-MCP
More information about the svlug
mailing list