wok view pi-blaster/stuff/init.d/pi-blaster @ rev 18296

Up linux (3.2.71)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Aug 17 11:03:13 2015 +0200 (2015-08-17)
parents
children ff5fd8788cd9
line source
1 #!/bin/sh
2 # Start, stop and restart pi-blaster on SliTaz
3 #
4 # To start daemon at boot time, just put the right name in the $RUN_DAEMONS
5 # variable of /etc/rcS.conf and configure options with /etc/daemons.conf.
6 #
8 NAME=$(basename $0)
9 DESC="$NAME deamon"
10 DAEMON=$(which $NAME)
11 OPTIONS=""
12 PID=$(pidof $NAME)
14 case "$1" in
15 start)
16 if [ "$PID" ]; then
17 echo "$NAME is already running..."
18 else
19 echo -n "Starting $DESC: $NAME..."
20 ${DAEMON} ${OPTIONS}; status
21 fi ;;
22 stop)
23 if [ "$PID" ]; then
24 echo -n "Stopping $DESC: $NAME..."
25 killall ${NAME} 2>/dev/bull; status
26 else
27 echo "$NAME is not running..."
28 fi ;;
29 restart)
30 $0 stop && sleep 1 && $0 start ;;
31 *)
32 echo "Usage: $0 [start|stop|restart]" ;;
33 esac
34 exit 0