Sophie

Sophie

distrib > Mandriva > 2010.0 > x86_64 > by-pkgid > b43eb55359644d46513f448b0d0ae6dc > files > 10

apcupsd-3.14.7-1mdv2010.0.x86_64.rpm

#!/bin/sh
#
# This shell script if placed in /etc/apcupsd
# will be called by /etc/apcupsd/apccontrol when the    
# UPS goes back on to the mains after a power failure.
# We send an email message to root to notify him.
#
SYSADMIN=root
APCUPSD_MAIL="mail"

HOSTNAME=`hostname`
MSG="$HOSTNAME Power has returned"
#
(
   echo "Subject: $MSG"
   echo " "
   echo "$MSG"
   echo " "
   /sbin/apcaccess status
) | $APCUPSD_MAIL -s "$MSG" $SYSADMIN
exit 0