| b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | # | ||||
| 3 | # This shell script if placed in /etc/apcupsd | ||||
| 4 | # will be called by /etc/apcupsd/apccontrol when the UPS | ||||
| 5 | # goes on batteries. | ||||
| 6 | # We send an email message to root to notify him. | ||||
| 7 | # | ||||
| 8 | . /etc/apcupsd/apcupsd_mail.conf | ||||
| 9 | |||||
| 10 | MSG="$HOSTNAME Power Failure !!!" | ||||
| 11 | # | ||||
| 12 | ( | ||||
| 13 | echo "$MSG" | ||||
| 14 | echo " " | ||||
| 15 | /usr/sbin/apcaccess status | ||||
| 16 | ) | $MAILPROG -h $MAILHOST -f $FROM -s "$MSG" $TO | ||||
| 17 | exit 0 | ||||