Репозитории ALT
S: | 3.14.14-alt3 |
5.1: | 3.14.9-alt0.M51.1 |
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 |
Другие репозитории
Upstream: | 3.14.3 |
Группа :: Система/Серверы
Пакет: apcupsd
Главная Изменения Спек Патчи Исходники Загрузить Gear Bugs and 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.
#
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
MSG=${MSG}" "`date`
#
(
echo "$MSG"
echo " "
/sbin/apcaccess status
) | $MAIL -s "$MSG" $SYSADMIN
# additional actions can be placed to /etc/sysconfig/apcupsdmessages
[ -f /etc/sysconfig/apcupsdmessages ] && . /etc/sysconfig/apcupsdmessages
exit 0