wok diff pi-blaster/stuff/init.d/pi-blaster @ rev 22805
updated gawk (4.2.1 -> 5.0.1)
author | Hans-G?nter Theisgen |
---|---|
date | Tue Jan 28 10:03:39 2020 +0100 (2020-01-28) |
parents | dee220ae1803 |
children |
line diff
1.1 --- a/pi-blaster/stuff/init.d/pi-blaster Sat May 03 12:14:03 2014 +0200 1.2 +++ b/pi-blaster/stuff/init.d/pi-blaster Tue Jan 28 10:03:39 2020 +0100 1.3 @@ -4,9 +4,10 @@ 1.4 # To start daemon at boot time, just put the right name in the $RUN_DAEMONS 1.5 # variable of /etc/rcS.conf and configure options with /etc/daemons.conf. 1.6 # 1.7 +. /etc/init.d/rc.functions 1.8 1.9 NAME=$(basename $0) 1.10 -DESC="$NAME deamon" 1.11 +DESC="$(_ '%s daemon' $NAME)" 1.12 DAEMON=$(which $NAME) 1.13 OPTIONS="" 1.14 PID=$(pidof $NAME) 1.15 @@ -14,21 +15,22 @@ 1.16 case "$1" in 1.17 start) 1.18 if [ "$PID" ]; then 1.19 - echo "$NAME is already running..." 1.20 + _ '%s is already running.' $NAME 1.21 else 1.22 - echo -n "Starting $DESC: $NAME..." 1.23 + action 'Starting %s: %s...' "$DESC" $NAME 1.24 ${DAEMON} ${OPTIONS}; status 1.25 fi ;; 1.26 stop) 1.27 if [ "$PID" ]; then 1.28 - echo -n "Stopping $DESC: $NAME..." 1.29 - killall ${NAME} 2>/dev/bull; status 1.30 + action 'Stopping %s: %s...' "$DESC" $NAME 1.31 + killall ${NAME} 2>/dev/null; status 1.32 else 1.33 - echo "$NAME is not running..." 1.34 + _ '%s is not running.' $NAME 1.35 fi ;; 1.36 - restart) 1.37 + restart) 1.38 $0 stop && sleep 1 && $0 start ;; 1.39 - *) 1.40 - echo "Usage: $0 [start|stop|restart]" ;; 1.41 + *) 1.42 + emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]" 1.43 + newline ;; 1.44 esac 1.45 exit 0