UPS: apcupsd support with gui
[tomato.git] / release / src / router / apcupsd / examples / safe.apccontrol
blob2eef535dea41346ccf9b3838876439d56aa44ab3
1 #!/bin/sh
3 # Safe apccontrol for testing.
5 # This apccontrol can be used for testing without fear
6 # that it will bring your system down
7 # examples/safe.apccontrol. Generated from safe.apccontrol.in by configure.
9 prefix=/usr
10 exec_prefix=${prefix}
11 APCUPSD=/sbin/apcupsd
12 SHUTDOWN=/sbin/shutdown
13 SCRIPTDIR=/usr/local/apcupsd
16 case "$1" in
17 killpower)
18 wall <<EOF
19 apccontrol: ${APCUPSD} --killpower would have been.
21 EOF
23 commfailure)
24 wall <<EOF
25 apccontrol: Communications with UPS lost.
27 EOF
29 commok)
30 wall <<EOF
31 apccontrol: Communciations with UPS restored.
33 EOF
35 powerout)
36 wall <<EOF
37 apccontrol: Warning power loss detected.
39 EOF
41 onbattery)
42 wall <<EOF
43 apccontrol: Power failure. Running on UPS batteries.
45 EOF
47 offbattery)
48 wall <<EOF
49 apccontrol: Off battery. Mains returned.
51 EOF
53 failing)
54 wall <<EOF
55 apccontrol: UPS battery power exhaused. Doing shutdown.
57 EOF
59 timeout)
60 wall <<EOF
61 apccontrol: UPS battery runtime limit exceeded. Doing shutdown.
63 EOF
65 loadlimit)
66 wall <<EOF
67 apccontrol: UPS battery discharge limit reached. Doing shutdown.
69 EOF
71 runlimit)
72 wall <<EOF
73 apccontrol: UPS battery runtime percent reached. Doing shutdown.
75 EOF
77 doreboot)
78 wall <EOF
79 apccontrol: ${SHUTDOWN} for reboot would have been called.
81 EOF
83 doshutdown)
84 wall <<EOF
85 apccontrol: ${SHUTDOWN} for halt would have been called.
87 EOF
89 mainsback)
90 wall <<EOF
91 apccontrol: Power has returned...
93 EOF
95 annoyme)
96 wall <<EOF
97 apccontrol: Power problems please logoff.
99 EOF
101 emergency)
102 wall <<EOF
103 apccontrol: ${SHUTDOWN} for emergency halt would have been called.
107 changeme)
108 wall <<EOF
109 apccontrol: Emergency! UPS batteries have failed.
111 Change them NOW !
114 remotedown)
115 wall <<EOF
116 apccontrol: ${SHUTDOWN} for remote halt would have been called.
120 startselftest)
121 wall <<EOF
122 apccontrol: start self test would have been called.
126 endselftest)
127 wall <<EOF
128 apccontrol: end self test would have been called.
132 *) echo "Usage: ${0##*/} command"
133 echo " warning: this script is intended to be launched by"
134 echo " apcupsd and should never be launched by users."
135 exit 1
137 esac