Sophie

Sophie

distrib > Mandriva > 9.1 > ppc > by-pkgid > 37e222326095a93978d54b1564dd9954 > files > 336

apcupsd-3.10.5-1mdk.ppc.rpm

#!@SCRIPTSHELL@
#
#    Safe apccontrol for testing.
#
#  This apccontrol can be used for testing without fear
#  that it will bring your system down
#     @configure_input@
#
prefix=@prefix@
exec_prefix=@exec_prefix@
APCUPSD=@sbindir@/apcupsd
SHUTDOWN=@SHUTDOWN@
SCRIPTDIR=@sysconfdir@

#
case "$1" in
        killpower)
                wall <<EOF
apccontrol: ${APCUPSD} --killpower would have been.

EOF
        ;;
        commfailure)
                wall <<EOF
apccontrol: Warning serial port communications with UPS lost.

EOF
        ;;
        commok)
                wall <<EOF
apccontrol: Serial communciations with UPS restored.

EOF
        ;;
        powerout)
                wall <<EOF
apccontrol: Warning power loss detected.

EOF
        ;;
        onbattery)
                wall <<EOF
apccontrol: Power failure. Running on UPS batteries.

EOF
        ;;
        failing)
                wall <<EOF
apccontrol: UPS battery power exhaused. Doing shutdown.

EOF
        ;;
        timeout)
                wall <<EOF
apccontrol: UPS battery runtime limit exceded. Doing shutdown.

EOF
        ;;
        loadlimit)
                wall <<EOF
apccontrol: UPS battery discharge limit reached. Doing shutdown.

EOF
        ;;
        runlimit)
                wall <<EOF
apccontrol: UPS battery runtime percent reached. Doing shutdown.

EOF
        ;;
        doreboot)
                wall <EOF
apccontrol: ${SHUTDOWN} for reboot would have been called.

EOF
        ;;
        doshutdown)
                wall <<EOF
apccontrol: ${SHUTDOWN} for halt would have been called.

EOF
        ;;
        mainsback)
                wall <<EOF
apccontrol: Power has returned...

EOF
        ;;
        annoyme)
                wall <<EOF
apccontrol: Power problems please logoff.

EOF
        ;;
        emergency)
                wall <<EOF
apccontrol: ${SHUTDOWN} for emergency halt would have been called.

EOF
        ;;
        changeme)
                wall <<EOF
apccontrol: Emergency! UPS batteries have failed.

Change them NOW !
EOF
        ;;
        remotedown)
                wall <<EOF
apccontrol: ${SHUTDOWN} for remote halt would have been called.

EOF
        ;;
        restartme)
                wall <<EOF
apccontrol: restarting apcupsd would have been called.

EOF
        ;;
        startselftest)
                wall <<EOF
apccontrol: start self test would have been called.

EOF
        ;;
        endselftest)
                wall <<EOF
apccontrol: end self test would have been called.

EOF
        ;;
        mastertimeout)
                wall <<EOF
apccontrol: Warning connection to master lost.

EOF
        ;;
        masterconnect)
                wall <<EOF
apccontrol: Connection to master established.

EOF
        ;;
        *)      echo "Usage: ${0##*/} command"
                echo "       warning: this script is intended to be launched by"
                echo "       apcupsd and should never be launched by users."
                exit 1
        ;;
esac