wok diff apache/stuff/apache @ 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 06c9ab3aa2fa
children 8ed3403d8a9e
line diff
     1.1 --- a/apache/stuff/apache	Fri Nov 13 10:58:30 2015 +0100
     1.2 +++ b/apache/stuff/apache	Thu May 26 20:16:45 2016 +0300
     1.3 @@ -1,5 +1,5 @@
     1.4  #!/bin/sh
     1.5 -# /etc/init.d/apache: Start, stop and restart Apache web server on SliTaz, 
     1.6 +# /etc/init.d/apache: Start, stop and restart Apache web server on SliTaz,
     1.7  # at boot time or with the command line. Daemons options are configured
     1.8  # with /etc/daemons.conf
     1.9  #
    1.10 @@ -7,7 +7,7 @@
    1.11  . /etc/daemons.conf
    1.12  
    1.13  NAME=Apache
    1.14 -DESC="Apache Web Server"
    1.15 +DESC="$(_ 'Apache Web Server')"
    1.16  DAEMON=/usr/bin/apachectl
    1.17  OPTIONS=$APACHE_OPTIONS
    1.18  PIDFILE=/var/run/apache/httpd.pid
    1.19 @@ -15,45 +15,44 @@
    1.20  case "$1" in
    1.21    start)
    1.22      if active_pidfile $PIDFILE httpd ; 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 -    $DAEMON $OPTIONS -k start 
    1.29 +    action 'Starting %s: %s...' "$DESC" $NAME
    1.30 +    $DAEMON $OPTIONS -k start
    1.31      status
    1.32      ;;
    1.33    stop)
    1.34      if ! active_pidfile $PIDFILE httpd ; then
    1.35 -      echo "$NAME is not running."
    1.36 +      _ '%s is not running.' $NAME
    1.37        exit 1
    1.38      fi
    1.39 -    echo -n "Stopping $DESC: $NAME... "
    1.40 +    action 'Stopping %s: %s...' "$DESC" $NAME
    1.41      $DAEMON $OPTIONS -k stop
    1.42      rm $PIDFILE
    1.43      status
    1.44      ;;
    1.45    reload)
    1.46      if ! active_pidfile $PIDFILE httpd ; then
    1.47 -      echo "$NAME is not running."
    1.48 +      _ '%s is not running.' $NAME
    1.49        exit 1
    1.50      fi
    1.51 -    echo -n "Stopping $DESC: $NAME... "
    1.52 +    action 'Stopping %s: %s...' "$DESC" $NAME
    1.53      $DAEMON $OPTIONS -k graceful
    1.54      status
    1.55      ;;
    1.56    restart)
    1.57      if ! active_pidfile $PIDFILE httpd ; then
    1.58 -      echo "$NAME is not running."
    1.59 +      _ '%s is not running.' $NAME
    1.60        exit 1
    1.61      fi
    1.62 -    echo -n "Restarting $DESC: $NAME... "
    1.63 +    action 'Restarting %s: %s...' "$DESC" $NAME
    1.64      $DAEMON $OPTIONS -k restart
    1.65      status
    1.66      ;;
    1.67    *)
    1.68 -    echo ""
    1.69 -    echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|reload|restart]"
    1.70 -    echo ""
    1.71 +    emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|reload|restart]"
    1.72 +    newline
    1.73      exit 1
    1.74      ;;
    1.75  esac