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 # Update October 7th, 2001 - CPE
11 APCPID
=@PIDDIR@
/apcupsd.pid
13 POWERFAILDIR
=@PWRFAILDIR@
22 rm -f ${POWERFAILDIR}/powerfail
23 echo "Starting apcupsd power management ...\c"
24 ${SBINDIR}/apcupsd ||
return=" Failed."
25 touch ${LOCKDIR}/apcupsd
29 echo "Stopping apcupsd power management ...\c"
30 if [ -f ${APCPID} ]; then
31 THEPID
=`cat ${APCPID}`
32 kill ${THEPID} ||
return=" Failed."
37 rm -f ${LOCKDIR}/apcupsd
45 ${SBINDIR}/apcaccess status
48 echo "Usage: $0 {start|stop|restart|status}"