UPS: apcupsd clean sources
[tomato.git] / release / src / router / apcupsd / platforms / etc / commfailure.in
blobdb5f03a1ed56356a9d5a5f87070adfde500baf5e
1 #!/bin/sh
3 # This shell script if placed in /etc/apcupsd
4 # will be called by /etc/apcupsd/apccontrol when apcupsd
5 # loses contact with the UPS (i.e. the serial connection is not responding).
6 # We send an email message to root to notify him.
8 SYSADMIN=root
9 APCUPSD_MAIL="@APCUPSD_MAIL@"
11 HOSTNAME=`hostname`
12 MSG="$HOSTNAME Communications with UPS lost"
15 echo "Subject: $MSG"
16 echo " "
17 echo "$MSG"
18 echo " "
19 @sbindir@/apcaccess status
20 ) | $APCUPSD_MAIL -s "$MSG" $SYSADMIN
21 exit 0