3 # apcupsd This shell script takes care of starting and stopping
4 # the apcupsd UPS monitoring daemon.
6 # chkconfig: 2345 20 99
7 # description: apcupsd monitors power and takes action if necessary
9 APCPID
=@PIDDIR@
/apcupsd.pid
17 rm -f @PWRFAILDIR@
/powerfail
18 rm -f @nologdir@
/nologin
19 echo -n "Starting apcupsd power management.."
20 if [ -f ${APCPID} ]; then
21 return=" Already running."
23 @sbindir@
/apcupsd
&& touch @LOCKDIR@
/subsys
/apcupsd \
30 echo -n "Stopping apcupsd power management.."
31 if [ -f ${APCPID} ]; then
32 THEPID
=`cat ${APCPID}`
33 kill ${THEPID} ||
return=" Failed."
36 return=" Nothing to stop."
38 rm -f @LOCKDIR@
/subsys
/apcupsd
46 @sbindir@
/apcaccess status
49 echo "Usage: $0 {start|stop|restart|status}"