ALT Linux repositórios
S: | 3.14.14-alt3 |
5.0: | 3.14.4-alt5 |
4.1: | 3.14.8-alt0.M41.1 |
4.0: | 3.14.3-alt0.M40.1 |
3.0: | 3.10.17-alt1 |
+updates: | 3.10.18-alt0.C30.1 |
Outros repositórios
Upstream: | 3.14.3 |
Group :: Sistema/Servidores
RPM: apcupsd
Main Changelog Spec Patches Sources Download Gear Bugs e FR Repocop
#!/bin/sh
#
# This shell script if placed in /etc/apcupsd
# will be called by /etc/apcupsd/apccontrol via
# symlinks generated by makesymlinks script
# when the UPS goes on batteries.
# We send an email message to root to notify him.
#
# It's need of "sed" !
#
SYSADMIN=root
MAIL="mail"
HOSTNAME=`hostname`
COLOR=""
NAME=`echo $0 | sed 's|^.*/||'`
case $NAME in
onbattery)
MSG="$HOSTNAME Power Failure !!!"
;;
offbattery)
MSG="$HOSTNAME Power has returned"
;;
commok)
MSG="$HOSTNAME Serial port communications with UPS restored"
;;
commfailure)
MSG="$HOSTNAME Serial port communications with UPS lost"
;;
changeme)
MSG="$HOSTNAME UPS battery needs changing NOW."
;;
masterconnect)
MSG="slave $HOSTNAME received connection from master"
;;
mastertimeout)
MSG="slave $HOSTNAME lost contact with master"
;;
upsdmessages)
MSG="$HOSTNAME test upsdmessages."
;;
*)
MSG="$HOSTNAME unknown excecute upsdmessages."
esac
#
(
echo "$MSG"
echo " "
/sbin/apcaccess status
) | $MAIL -s "$MSG" $SYSADMIN
exit 0