blogic 204f73c930 adds apcupsd, thanks Matthias Eller , fixes #2157
git-svn-id: svn://svn.openwrt.org/openwrt/packages@11971 3c298f89-4303-0410-b956-a3cf2f4a3e73
2008-07-28 16:51:41 +00:00

18 lines
414 B
Bash

#!/bin/sh
#
# This shell script if placed in /etc/apcupsd
# will be called by /etc/apcupsd/apccontrol when apcupsd
# detects that the battery should be replaced.
# We send an email message to root to notify him.
#
. /etc/apcupsd/apcupsd_mail.conf
MSG="$HOSTNAME UPS battery needs changing NOW."
#
(
echo "$MSG"
echo " "
/usr/sbin/apcaccess status
) | $MAILPROG -h $MAILHOST -F $FROM -s "$MSG" $TO
exit 0