diff options
Diffstat (limited to 'sysutils/apcupsd/files/apcupsd.sh.sample')
-rw-r--r-- | sysutils/apcupsd/files/apcupsd.sh.sample | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/sysutils/apcupsd/files/apcupsd.sh.sample b/sysutils/apcupsd/files/apcupsd.sh.sample deleted file mode 100644 index 567c4a65eb46..000000000000 --- a/sysutils/apcupsd/files/apcupsd.sh.sample +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh -# $FreeBSD$ -# startup scripts for APCUPSD. - -if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then - echo "$0: Cannot determine the PREFIX" >&2 - exit 1 -fi - -# If there is a global system configuration file, suck it in. -if [ -r /etc/defaults/rc.conf ]; then - . /etc/defaults/rc.conf - source_rc_confs -elif [ -r /etc/rc.conf ]; then - . /etc/rc.conf -fi - -apcupsd_enable=${apcupsd_enable:-YES} -apcupsd_program=${apcupsd_program:-${PREFIX}/sbin/apcupsd} -apcupsd_flags=${apcupsd_flags:-"--kill-on-powerfail"} -apcupsd_pidfile=${apcupsd_pidfile:-/var/run/apcupsd.pid} -apcupsd_lockfile=${apcupsd_lockfile:-/var/spool/lock/apcupsd.lock} - -case $1 in - start) - case "${apcupsd_enable}" in - [Yy][Ee][Ss]) - rm -f /var/run/powerfail - rm -f /var/run/nologin - if [ -f ${apcupsd_program} ]; then - echo -n " apcupsd" - ${apcupsd_program} ${apcupsd_flags} || return=" Failed." - touch ${apcupsd_lockfile} - fi - ;; - esac - ;; - - stop) - if [ -f ${apcupsd_pidfile} ]; then - PID=`cat ${apcupsd_pidfile}` - kill -KILL $PID || return=" Failed." - rm -f ${apcupsd_pidfile} - # some slaves won't die - killall apcupsd > /dev/null 2>&1 - echo " apcupsd killed" - else - return=" Failed." - fi - ;; - - restart) - $0 stop - $0 start; - ;; - - status) - ${PREFIX}/sbin/apcaccess status - ;; - - *) - echo "usage: $0 {start|stop|restart|status}" 1>&2 - ;; -esac - -exit 0; |