wok diff ddclient/stuff/ddclient @ 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 67dae61c7bb1
children ff5fd8788cd9
line diff
     1.1 --- a/ddclient/stuff/ddclient	Sun Dec 06 12:23:33 2009 +0100
     1.2 +++ b/ddclient/stuff/ddclient	Thu May 26 20:16:45 2016 +0300
     1.3 @@ -8,7 +8,7 @@
     1.4  . /etc/init.d/rc.functions
     1.5  
     1.6  NAME=DDclient
     1.7 -DESC="ddclient dynamic IP manager"
     1.8 +DESC="$(_ 'dynamic IP manager')"
     1.9  DAEMON=/usr/sbin/ddclient
    1.10  PID_FILE=/var/run/ddclient.pid
    1.11  OPTION="-pid $PID_FILE"
    1.12 @@ -16,29 +16,29 @@
    1.13  case "$1" in
    1.14    start)
    1.15      if active_pidfile $PID_FILE ddclient ; then
    1.16 -      echo "$NAME already running."
    1.17 +      _ '%s is already running.' $NAME
    1.18        exit 1
    1.19      fi
    1.20 -    echo -n "Starting $DESC: $NAME... "
    1.21 +    action 'Starting %s: %s...' "$DESC" $NAME
    1.22      $DAEMON $OPTION
    1.23      status
    1.24      ;;
    1.25    stop)
    1.26      if ! active_pidfile $PID_FILE ddclient ; then
    1.27 -      echo "$NAME is not running."
    1.28 +      _ '%s is not running.' $NAME
    1.29        exit 1
    1.30      fi
    1.31 -    echo -n "Stopping $DESC: $NAME... "
    1.32 +    action 'Stopping %s: %s...' "$DESC" $NAME
    1.33      killall ddclient
    1.34      rm $PID_FILE
    1.35      status
    1.36      ;;
    1.37    restart)
    1.38      if ! active_pidfile $PID_FILE ddclient ; 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 "Restarting $DESC: $NAME... "
    1.44 +    action 'Restarting %s: %s...' "$DESC" $NAME
    1.45      killall ddclient
    1.46      rm $PID_FILE
    1.47      sleep 2
    1.48 @@ -46,9 +46,8 @@
    1.49      status
    1.50      ;;
    1.51    *)
    1.52 -    echo ""
    1.53 -    echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]"
    1.54 -    echo ""
    1.55 +    emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]"
    1.56 +    newline
    1.57      exit 1
    1.58      ;;
    1.59  esac