wok view acpid/stuff/init.d/acpid @ rev 2114

Add: SuperTux 0.1.3
author Mallory MOLLO <mallory@skyrock.com>
date Fri Jan 30 00:46:35 2009 +0100 (2009-01-30)
parents fd13f7f143da
children 320b5d1cf5fc
line source
1 #!/bin/sh
2 # /etc/init.d/acpid: Start, stop and restart acpid deamon on SliTaz, at boot
3 # time or with the command line.
4 #
5 # To start daemon at boot time, just put the right name in the $RUN_DAEMONS
6 # variable of /etc/rcS.conf and configure options with /etc/daemons.conf.
7 #
8 . /etc/init.d/rc.functions
9 . /etc/daemons.conf
11 NAME=acpid
12 DESC="ACPI event deamon"
13 DAEMON=/usr/sbin/acpid
14 OPTIONS=$ACPID_OPTIONS
15 NPID=`ps ax | grep $DAEMON | wc -l`
16 PID=`ps ax | grep $DAEMON | awk '{print $1}'`
18 case "$1" in
19 start)
20 if [ $NPID -ne 0 ] ; then
21 echo "$NAME already running."
22 exit 1
23 fi
24 echo -n "Starting $DESC: $NAME... "
25 $DAEMON $OPTIONS > /dev/null
26 status
27 ;;
28 stop)
29 if [ $NPID -eq 0 ] ; then
30 echo "$NAME is not running."
31 exit 1
32 fi
33 echo -n "Stopping $DESC: $NAME... "
34 kill $PID
35 status
36 ;;
37 restart)
38 if [ $NPID -eq 0 ] ; then
39 echo "$NAME is not running."
40 exit 1
41 fi
42 echo -n "Restarting $DESC: $NAME... "
43 kill $PID
44 sleep 2
45 $DAEMON $OPTIONS > /dev/null
46 status
47 ;;
48 *)
49 echo ""
50 echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]"
51 echo ""
52 exit 1
53 ;;
54 esac
56 exit 0