wok diff motion/stuff/init.d/motion @ rev 19159

/etc/init.d/*: use 'action' in pair with 'status'.
'action' returns translated message, so why not to add full translatable /etc/init.d/* content
author Aleksej Bobylev <al.bobylev@gmail.com>
date Thu May 26 20:16:45 2016 +0300 (2016-05-26)
parents 3c13a1e665f2
children 7c04901ef470
line diff
     1.1 --- a/motion/stuff/init.d/motion	Mon Nov 19 14:21:21 2012 +0100
     1.2 +++ b/motion/stuff/init.d/motion	Thu May 26 20:16:45 2016 +0300
     1.3 @@ -6,42 +6,46 @@
     1.4  . /etc/init.d/rc.functions
     1.5  
     1.6  NAME=Motion
     1.7 -DESC="Video detection"
     1.8 +DESC="$(_ 'Video detection daemon')"
     1.9  DAEMON=/usr/bin/motion
    1.10  PIDFILE=/run/motion/motion.pid
    1.11  
    1.12  case "$1" in
    1.13  	start)
    1.14  		if active_pidfile $PIDFILE motion ; then
    1.15 -			echo "$NAME already running."
    1.16 +			_ '%s is already running.' $NAME
    1.17  			exit 1
    1.18  		fi
    1.19 -		echo "Starting $DESC: $NAME... "
    1.20 +		action 'Starting %s: %s...' "$DESC" $NAME
    1.21  		mkdir -p $(dirname $PIDFILE)
    1.22 -		$DAEMON -p $PIDFILE ;;
    1.23 +		$DAEMON -p $PIDFILE
    1.24 +		status
    1.25 +		;;
    1.26  	stop)
    1.27  		if ! active_pidfile $PIDFILE motion ; then
    1.28 -			echo "$NAME is not running."
    1.29 +			_ '%s is not running.' $NAME
    1.30  			exit 1
    1.31  		fi
    1.32 -		echo -n "Stopping $DESC: $NAME... "
    1.33 +		action 'Stopping %s: %s...' "$DESC" $NAME
    1.34  		kill $(cat $PIDFILE)
    1.35  		rm $PIDFILE
    1.36 -		status ;;
    1.37 +		status
    1.38 +		;;
    1.39  	restart)
    1.40  		if ! active_pidfile $PIDFILE motion ; then
    1.41  			echo "$NAME is not running."
    1.42  			exit 1
    1.43  		fi
    1.44 -		echo "Restarting $DESC: $NAME... "
    1.45 +		_ 'Restarting %s: %s...' "$DESC" $NAME
    1.46  		kill $(cat $PIDFILE)
    1.47  		rm $PIDFILE
    1.48  		sleep 2
    1.49 -		$DAEMON -p $PIDFILE ;;
    1.50 +		$DAEMON -p $PIDFILE
    1.51 +		status
    1.52 +		;;
    1.53  	*)
    1.54 -		echo ""
    1.55 -		echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]"
    1.56 -		echo ""
    1.57 +		emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]"
    1.58 +		newline
    1.59  		exit 1 ;;
    1.60  esac
    1.61