From: <smi...@us...> - 2004-03-15 01:31:53
|
Update of /cvsroot/devil-linux/build/scripts/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9239/scripts/scripts Added Files: apcupsd Log Message: initial checkin of apcupsd --- NEW FILE: apcupsd --- #!/bin/bash # # $Source: /cvsroot/devil-linux/build/scripts/scripts/apcupsd,v $ # $Revision: 1.1 $ # $Date: 2004/03/15 01:22:52 $ # # http://www.devil-linux.org # ### BEGIN INIT INFO # Provides: apcupsd # Required-Start: $network $syslog # Required-Stop: $network $syslog # Default-Start: 2 3 5 # Default-Stop: 6 0 # Description: starts apcupsd ### END INIT INFO # settings source /etc/sysconfig/config # parameters NAME="apcupsd" CONFIGNAME=APCUPSD DAEMON=/sbin/apcupsd PARAMETER= # source function library source /etc/init.d/functions eval START=\$START_$CONFIGNAME # Determine the base and follow a runlevel link name. base=${0##*/} link=${base#*[SK][0-9][0-9]} # Force execution if not called by a runlevel directory. test $link = $base && START=yes test "$START" = "yes" || exit 0 if [ ! -e $DAEMON ]; then echo "$DAEMON not found. Did you install the package?" exit 1 fi case "$1" in start) rm -f /etc/apcupsd/powerfail rm -f /etc/nologin echo -n "Starting $NAME" $DAEMON $PARAMETER &> /dev/null & evaluate_retval touch /var/lock/subsys/apcupsd ;; stop) echo -n "Shutting down $NAME: " killproc $DAEMON rm -f /var/lock/subsys/apcupsd ;; restart) $0 stop sleep 1 $0 start ;; status) /sbin/apcaccess status ;; *) echo "Usage: $0 {start|stop|restart|status}" exit 1 esac |