3 # apcupsd This shell script takes care of starting and stopping
4 # the apcupsd UPS monitoring daemon.
6 # Written by Adam Kropelin <akropel1@rochester.rr.com>
7 # Based on work by Ingo Nowak <nowak@koellernowak.de>
11 APCPID
=@PIDDIR@
/apcupsd.pid
12 APCLOCK
=@PIDDIR@
/apcupsd.lock
16 ConsoleMessage
"Starting UPS monitoring"
17 rm -f @PWRFAILDIR@
/powerfail
18 rm -f @nologdir@
/nologin
19 @sbindir@
/apcupsd
-f @sysconfdir@
/apcupsd.conf ||
exit 0
25 ConsoleMessage
"Shutting down UPS monitoring"
26 if [ -f ${APCPID} ]; then
27 kill `cat ${APCPID}` ||
exit 0
40 # Typically we'd just use RunService from /etc/rc.common here, but rumor
41 # has it Mac OS 10.1.x and earlier do not have that function so we'll
42 # implement it ourselves.
54 echo "$0: unknown argument: $1"