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

Up glza (0.11.4)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat May 21 21:38:29 2022 +0000 (24 months ago)
parents dee220ae1803
children
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 #
7 . /etc/init.d/rc.functions
9 NAME=$(basename $0)
10 DESC="$(_ '%s daemon' $NAME)"
11 DAEMON=$(which $NAME)
12 OPTIONS=""
13 PID=$(pidof $NAME)
15 case "$1" in
16 start)
17 if [ "$PID" ]; then
18 _ '%s is already running.' $NAME
19 else
20 action 'Starting %s: %s...' "$DESC" $NAME
21 ${DAEMON} ${OPTIONS}; status
22 fi ;;
23 stop)
24 if [ "$PID" ]; then
25 action 'Stopping %s: %s...' "$DESC" $NAME
26 killall ${NAME} 2>/dev/null; status
27 else
28 _ '%s is not running.' $NAME
29 fi ;;
30 restart)
31 $0 stop && sleep 1 && $0 start ;;
32 *)
33 emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]"
34 newline ;;
35 esac
36 exit 0