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

14 lines
394 B
Plaintext
Raw Normal View History

2024-09-13 04:56:15 +00:00
#!/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