1
0
mirror of https://git.openwrt.org/feed/packages.git synced 2024-06-16 20:33:58 +02:00
openwrt-packages/net/apcupsd/files/onbattery
Othmar Truniger a460965a67 apcupsd: move from old packages and Makefile updated
Signed-off-by: Othmar Truniger <Othmar Truniger github@truniger.ch>
2015-02-17 23:14:27 +01:00

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