Sisyphus repositório
Última atualização: 1 outubro 2023 | SRPMs: 18631 | Visitas: 37496353
en ru br
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.
#

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
 
projeto & código: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
mantenedor atual: Michael Shigorin
mantenedor da tradução: Fernando Martini aka fmartini © 2009