wok diff dovecot/stuff/init.d/dovecot @ 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 0d8a1a3edc72
children 1c049ccf6c26
line diff
     1.1 --- a/dovecot/stuff/init.d/dovecot	Sun May 18 20:24:07 2014 +0000
     1.2 +++ b/dovecot/stuff/init.d/dovecot	Thu May 26 20:16:45 2016 +0300
     1.3 @@ -1,5 +1,5 @@
     1.4  #!/bin/sh
     1.5 -# /etc/init.d/dovecot : Start, stop and restart Dovecotserver on SliTaz, at 
     1.6 +# /etc/init.d/dovecot : Start, stop and restart Dovecotserver 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 dovecot in the $RUN_DAEMONS
    1.10 @@ -9,7 +9,7 @@
    1.11  . /etc/daemons.conf
    1.12  
    1.13  NAME=dovecot
    1.14 -DESC="Dovecot daemon"
    1.15 +DESC="$(_ '%s daemon' Dovecot)"
    1.16  DAEMON=/usr/sbin/dovecot
    1.17  OPTIONS=$dovecot_OPTIONS
    1.18  PIDFILE=/var/run/dovecot/master.pid
    1.19 @@ -21,37 +21,36 @@
    1.20  case "$1" in
    1.21    start)
    1.22      if active_pidfile $PIDFILE dovecot ; 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      status
    1.31      ;;
    1.32    stop)
    1.33      if ! active_pidfile $PIDFILE dovecot ; then
    1.34 -      echo "$NAME is not running."
    1.35 +      _ '%s is not running.' $NAME
    1.36        exit 1
    1.37      fi
    1.38 -    echo -n "Stopping $DESC: $NAME... "
    1.39 -    kill `cat $PIDFILE`
    1.40 +    action 'Stopping %s: %s...' "$DESC" $NAME
    1.41 +    kill $(cat $PIDFILE)
    1.42      status
    1.43      ;;
    1.44    restart)
    1.45      if ! active_pidfile $PIDFILE dovecot ; then
    1.46 -      echo "$NAME is not running."
    1.47 +      _ '%s is not running.' $NAME
    1.48        exit 1
    1.49      fi
    1.50 -    echo -n "Restarting $DESC: $NAME... "
    1.51 -    kill `cat $PIDFILE`
    1.52 +    action 'Restarting %s: %s...' "$DESC" $NAME
    1.53 +    kill $(cat $PIDFILE)
    1.54      sleep 2
    1.55      $DAEMON $OPTIONS
    1.56      status
    1.57      ;;
    1.58    *)
    1.59 -    echo ""
    1.60 -    echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]"
    1.61 -    echo ""
    1.62 +    emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]"
    1.63 +    newline
    1.64      exit 1
    1.65      ;;
    1.66  esac