Email notification of reboot

This can / should be setup using nagios, but here it is anyway!

  • Include this in cron.daily.
  • Change the email address before enabling.
#!/bin/sh -e
#
HOST=`hostname`
if [ -f /var/run/reboot-required ]; then
    #echo "Sytem will reboot in 5 minutes ..." | /usr/bin/wall
    #sleep 240
    #echo "Sytem will reboot in 1 minute ..." | /usr/bin/wall
    #sleep 60
    cat /var/run/reboot-required | mailx -s "Reboot required on $HOST" system@example.com
    #/sbin/reboot
fi

Table of Contents
QR Code
QR Code tech:linux:others:notify_reboot_req (generated for current page)