wok diff ypserv/stuff/ypserv @ 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 c994a5c94f9d
children
line diff
     1.1 --- a/ypserv/stuff/ypserv	Tue Nov 29 01:25:59 2011 +0100
     1.2 +++ b/ypserv/stuff/ypserv	Thu May 26 20:16:45 2016 +0300
     1.3 @@ -1,5 +1,5 @@
     1.4  #!/bin/sh
     1.5 -# /etc/init.d/ypserv: Start, stop and restart YP (NIS) Server on SliTaz, at 
     1.6 +# /etc/init.d/ypserv: Start, stop and restart YP (NIS) Server on SliTaz, at
     1.7  # boot time or with the command line.
     1.8  #
     1.9  # To start YP (NIS) Server at boot time, just put ypserver in the $RUN_DAEMONS
    1.10 @@ -9,7 +9,7 @@
    1.11  . /etc/daemons.conf
    1.12  
    1.13  NAME=ypserv
    1.14 -DESC="YP (NIS) Server"
    1.15 +DESC="$(_ '%s server' 'YP (NIS)')"
    1.16  DAEMON=/usr/sbin/ypserv
    1.17  OPTIONS=$YPSERV_OPTIONS
    1.18  PIDFILE=/var/run/ypserv.pid
    1.19 @@ -17,38 +17,37 @@
    1.20  case "$1" in
    1.21    start)
    1.22      if active_pidfile $PIDFILE ypserv ; then
    1.23 -      echo "$NAME already running."
    1.24 +      _ '%s is already running.' $NAME
    1.25        exit 1
    1.26      fi
    1.27 -    echo -n "Starting $DESC: $NAME... "
    1.28 +    action 'Starting %s: %s...' "$DESC" $NAME
    1.29      $DAEMON $OPTIONS
    1.30 -    echo "$(pidof ypserv)" > $PIDFILE
    1.31 +    pidof ypserv > $PIDFILE
    1.32      status
    1.33      ;;
    1.34    stop)
    1.35      if ! active_pidfile $PIDFILE ypserv ; then
    1.36 -      echo "$NAME is not running."
    1.37 +      _ '%s is not running.' $NAME
    1.38        exit 1
    1.39      fi
    1.40 -    echo -n "Stopping $DESC: $NAME... "
    1.41 -    kill `cat $PIDFILE`
    1.42 +    action 'Stopping %s: %s...' "$DESC" $NAME
    1.43 +    kill $(cat $PIDFILE)
    1.44      status
    1.45      ;;
    1.46    restart)
    1.47      if ! active_pidfile $PIDFILE ypserv ; then
    1.48 -      echo "$NAME is not running."
    1.49 +      _ '%s is not running.'
    1.50        exit 1
    1.51      fi
    1.52 -    echo -n "Restarting $DESC: $NAME... "
    1.53 -    kill `cat $PIDFILE`
    1.54 +    action 'Restarting %s: %s...' "$DESC" $NAME
    1.55 +    kill $(cat $PIDFILE)
    1.56      sleep 2
    1.57      $DAEMON $OPTIONS
    1.58      status
    1.59      ;;
    1.60    *)
    1.61 -    echo ""
    1.62 -    echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]"
    1.63 -    echo ""
    1.64 +    emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]"
    1.65 +    newline
    1.66      exit 1
    1.67      ;;
    1.68  esac