wok annotate pi-blaster/stuff/init.d/pi-blaster @ rev 19294
sane-backends, scons, scrot, shell-fm, smake, soundtouch, wireless_tools: fix man or doc path
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Wed Jul 06 16:30:34 2016 +0200 (2016-07-06) |
parents | dee220ae1803 |
children |
rev | line source |
---|---|
pankso@16577 | 1 #!/bin/sh |
pankso@16577 | 2 # Start, stop and restart pi-blaster on SliTaz |
pankso@16577 | 3 # |
pankso@16577 | 4 # To start daemon at boot time, just put the right name in the $RUN_DAEMONS |
pankso@16577 | 5 # variable of /etc/rcS.conf and configure options with /etc/daemons.conf. |
pankso@16577 | 6 # |
al@19161 | 7 . /etc/init.d/rc.functions |
pankso@16577 | 8 |
pankso@16577 | 9 NAME=$(basename $0) |
al@19161 | 10 DESC="$(_ '%s daemon' $NAME)" |
pankso@16577 | 11 DAEMON=$(which $NAME) |
pankso@16577 | 12 OPTIONS="" |
pankso@16577 | 13 PID=$(pidof $NAME) |
pankso@16577 | 14 |
pankso@16577 | 15 case "$1" in |
pankso@16577 | 16 start) |
pankso@16577 | 17 if [ "$PID" ]; then |
al@19161 | 18 _ '%s is already running.' $NAME |
pankso@16577 | 19 else |
al@19161 | 20 action 'Starting %s: %s...' "$DESC" $NAME |
pankso@16577 | 21 ${DAEMON} ${OPTIONS}; status |
pankso@16577 | 22 fi ;; |
pankso@16577 | 23 stop) |
pankso@16577 | 24 if [ "$PID" ]; then |
al@19161 | 25 action 'Stopping %s: %s...' "$DESC" $NAME |
al@19161 | 26 killall ${NAME} 2>/dev/null; status |
pankso@16577 | 27 else |
al@19161 | 28 _ '%s is not running.' $NAME |
pankso@16577 | 29 fi ;; |
al@19161 | 30 restart) |
pankso@16577 | 31 $0 stop && sleep 1 && $0 start ;; |
al@19161 | 32 *) |
al@19161 | 33 emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]" |
al@19161 | 34 newline ;; |
pankso@16577 | 35 esac |
pankso@16577 | 36 exit 0 |