1
0
Fork 0
home-stack-ansible/roles/nut-client/files/upssched-cmd

14 lines
394 B
Bash

#!/bin/sh
case $1 in
shutdown)
logger -t upssched-cmd "UPS on battery too long, shutdown"
/usr/bin/sudo /usr/sbin/shutdown -h +0
;;
shutdown-critical)
logger -t upssched-cmd "UPS on battery critical, forced shutdown"
/usr/sbin/upsmon -c fsd
;;
*)
logger -t upssched-cmd "Unrecognized command: $1"
;;
esac