wok diff ntop/stuff/etc/init.d/ntop @ 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
'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 | ba5507fa22f8 |
children |
line diff
1.1 --- a/ntop/stuff/etc/init.d/ntop Sat Feb 18 17:18:01 2012 +0100 1.2 +++ b/ntop/stuff/etc/init.d/ntop Thu May 26 20:16:45 2016 +0300 1.3 @@ -1,5 +1,5 @@ 1.4 #!/bin/sh 1.5 -# /etc/init.d/ntop : Start, stop and restart ntop daemon on SliTaz, at 1.6 +# /etc/init.d/ntop : Start, stop and restart ntop daemon on SliTaz, at 1.7 # boot time or with the command line. 1.8 # 1.9 # To start SSH server at boot time, just put ntop in the $RUN_DAEMONS 1.10 @@ -9,7 +9,7 @@ 1.11 1.12 1.13 NAME=ntop 1.14 -DESC="ntop server" 1.15 +DESC="$(_ '%s server' ntop)" 1.16 DAEMON=/usr/bin/ntop 1.17 1.18 HTTP_PORT="3000" 1.19 @@ -23,41 +23,40 @@ 1.20 case "$1" in 1.21 start) 1.22 if active_pidfile $PIDFILE $NAME ; then 1.23 - echo "$NAME already running." 1.24 + _ '%s is already running.' $NAME 1.25 exit 1 1.26 fi 1.27 # We need to set ntop admin password. 1.28 if [ ! -f /var/ntop/ntop_pw.db ] ; then 1.29 - ntop -A || exit 1.30 + ntop -A || exit 1.31 fi 1.32 - echo -n "Starting $DESC: $NAME... " 1.33 + action 'Starting %s: %s...' "$DESC" $NAME 1.34 $DAEMON $OPTIONS >> $LOGFILE 1.35 status 1.36 ;; 1.37 stop) 1.38 if ! active_pidfile $PIDFILE $NAME ; then 1.39 - echo "$NAME is not running." 1.40 + _ '%s is not running.' $NAME 1.41 exit 1 1.42 fi 1.43 - echo -n "Stopping $DESC: $NAME... " 1.44 - kill `cat $PIDFILE` && rm -f $PIDFILE 1.45 + action 'Stopping %s: %s...' "$DESC" $NAME 1.46 + kill $(cat $PIDFILE) && rm -f $PIDFILE 1.47 status 1.48 ;; 1.49 restart) 1.50 if ! active_pidfile $PIDFILE $NAME ; then 1.51 - echo "$NAME is not running." 1.52 + _ '%s is not running.' $NAME 1.53 exit 1 1.54 fi 1.55 - echo -n "Restarting $DESC: $NAME... " 1.56 - kill `cat $PIDFILE` && rm -f $PIDFILE 1.57 + action 'Restarting %s: %s...' "$DESC" $NAME 1.58 + kill $(cat $PIDFILE) && rm -f $PIDFILE 1.59 sleep 2 1.60 $DAEMON $OPTIONS 1.61 status 1.62 ;; 1.63 *) 1.64 - echo "" 1.65 - echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]" 1.66 - echo "" 1.67 + emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]" 1.68 + newline 1.69 exit 1 1.70 ;; 1.71 esac