Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
$ sudo vi /etc/nut/upssched.conf



Ensure that the CMDSCRIPT is setSet  the following

Code Block
CMDSCRIPT /binetc/nut/upssched-cmd

Add the following

Code Block

  
# Timer to shutdown machine after 60 seconds
AT ONBATT * START-TIMER onbattwarn 60
AT ONLINE * CANCEL-TIMER onbattwarn

...

Edit the Command Script

Code Block
$ sudo vi /etc/binnut/upssched-cmd


Code Block
case $1 in
        onbattwarn)
                logger -t upssched-cmd "Timer On Battery Warning has been triggered - Shutting Down!"
                wall "UPS timer expired: shutting down..."
                shutdown -h now
                ;;
        *)
                logger -t upssched-cmd "Unrecognized command: $1"
                ;;
esac

...