204f73c930
git-svn-id: svn://svn.openwrt.org/openwrt/packages@11971 3c298f89-4303-0410-b956-a3cf2f4a3e73
18 lines
374 B
Bash
18 lines
374 B
Bash
#!/bin/sh
|
|
#
|
|
# This shell script if placed in /etc/apcupsd
|
|
# will be called by /etc/apcupsd/apccontrol when the UPS
|
|
# goes on batteries.
|
|
# We send an email message to root to notify him.
|
|
#
|
|
. /etc/apcupsd/apcupsd_mail.conf
|
|
|
|
MSG="$HOSTNAME Power Failure !!!"
|
|
#
|
|
(
|
|
echo "$MSG"
|
|
echo " "
|
|
/usr/sbin/apcaccess status
|
|
) | $MAILPROG -h $MAILHOST -f $FROM -s "$MSG" $TO
|
|
exit 0
|