wok diff 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 (2022-05-21)
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	Sat May 21 21:38:29 2022 +0000
     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