Add pwrstatd config and scripts

This commit is contained in:
mr-vercetti
2022-06-22 14:14:02 +02:00
parent 0ab2df2f90
commit 2236a98c9e
3 changed files with 161 additions and 0 deletions

14
pwrstatd/pwrstatd-powerfail.sh Executable file
View File

@@ -0,0 +1,14 @@
#!/bin/bash
echo "Warning: Utility power failure has occurred for a while, system is now powered by UPS" | wall
# Enable to send email
enable_email="yes"
# Send email using "/etc/sg-send-mail.sh" script
email_from=""
email_to=""
email_sender=""
if [[ $enable_email == "yes" ]]; then
/etc/sg-send-email.sh -f ${email_from} -n ${email_sender} -t ${email_to} -s "Power failure on hustler'" -m "$(date)"
fi