wok annotate acpid/stuff/init.d/acpid @ rev 6857

Up: coreutils to 8.6.
author Christopher Rogers <slaxemulator@gmail.com>
date Wed Oct 20 11:34:25 2010 +0000 (2010-10-20)
parents b19e50dd80d8
children ea3814974a25
rev   line source
domcox@1512 1 #!/bin/sh
domcox@1512 2 # /etc/init.d/acpid: Start, stop and restart acpid deamon on SliTaz, at boot
domcox@1512 3 # time or with the command line.
domcox@1512 4 #
domcox@1512 5 # To start daemon at boot time, just put the right name in the $RUN_DAEMONS
domcox@1512 6 # variable of /etc/rcS.conf and configure options with /etc/daemons.conf.
domcox@1512 7 #
domcox@1512 8 . /etc/init.d/rc.functions
domcox@1512 9 . /etc/daemons.conf
domcox@1512 10
domcox@1512 11 NAME=acpid
domcox@1512 12 DESC="ACPI event deamon"
domcox@1512 13 DAEMON=/usr/sbin/acpid
domcox@1512 14 OPTIONS=$ACPID_OPTIONS
domcox@2653 15 PIDFILE=/var/run/acpid.pid
domcox@1512 16
domcox@1512 17 case "$1" in
domcox@1512 18 start)
domcox@2653 19 if [ -f $PIDFILE ] ; then
domcox@1512 20 echo "$NAME already running."
domcox@1512 21 exit 1
domcox@1512 22 fi
domcox@1512 23 echo -n "Starting $DESC: $NAME... "
domcox@2653 24 $DAEMON $OPTIONS
domcox@1512 25 status
domcox@1512 26 ;;
domcox@1512 27 stop)
domcox@2653 28 if [ ! -f $PIDFILE ] ; then
domcox@1512 29 echo "$NAME is not running."
domcox@1512 30 exit 1
domcox@1512 31 fi
domcox@1512 32 echo -n "Stopping $DESC: $NAME... "
domcox@2653 33 kill `cat $PIDFILE`
domcox@1512 34 status
domcox@1512 35 ;;
domcox@1512 36 restart)
domcox@2653 37 if [ ! -f $PIDFILE ] ; then
domcox@1512 38 echo "$NAME is not running."
domcox@1512 39 exit 1
domcox@1512 40 fi
domcox@1512 41 echo -n "Restarting $DESC: $NAME... "
domcox@2653 42 kill `cat $PIDFILE`
domcox@1512 43 sleep 2
domcox@2653 44 $DAEMON $OPTIONS
domcox@1512 45 status
domcox@1512 46 ;;
domcox@1512 47 *)
domcox@1512 48 echo ""
domcox@1512 49 echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]"
domcox@1512 50 echo ""
domcox@1512 51 exit 1
domcox@1512 52 ;;
domcox@1512 53 esac
domcox@1512 54
domcox@1512 55 exit 0