wok diff nginx/stuff/etc/init.d/nginx @ rev 20434

Add python-terminado
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Aug 31 19:02:12 2018 +0200 (2018-08-31)
parents bc2cb6189827
children 3d13c41224cd
line diff
     1.1 --- a/nginx/stuff/etc/init.d/nginx	Wed May 25 10:38:55 2011 +0200
     1.2 +++ b/nginx/stuff/etc/init.d/nginx	Fri Aug 31 19:02:12 2018 +0200
     1.3 @@ -1,5 +1,5 @@
     1.4  #!/bin/sh
     1.5 -# /etc/init.d/nginx: Start, stop and restart web server on SliTaz, 
     1.6 +# /etc/init.d/nginx: Start, stop and restart 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=Nginx
    1.14 -DESC="web server"
    1.15 +DESC="$(_ 'web server')"
    1.16  DAEMON=/usr/sbin/nginx
    1.17  OPTIONS=$NGINX_OPTIONS
    1.18  PIDFILE=/var/run/nginx.pid
    1.19 @@ -15,39 +15,38 @@
    1.20  case "$1" in
    1.21    start)
    1.22      if active_pidfile $PIDFILE nginx ; 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 
    1.29 +    action 'Starting %s: %s...' "$DESC" $NAME
    1.30 +    $DAEMON $OPTIONS
    1.31      status
    1.32      ;;
    1.33    stop)
    1.34      if ! active_pidfile $PIDFILE nginx ; 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 -    kill `cat $PIDFILE`
    1.41 +    action 'Stopping %s: %s...' "$DESC" $NAME
    1.42 +    kill $(cat $PIDFILE)
    1.43      rm $PIDFILE
    1.44      status
    1.45      ;;
    1.46    restart)
    1.47      if ! active_pidfile $PIDFILE nginx ; then
    1.48 -      echo "$NAME is not running."
    1.49 +      _ '%s is not running.' $NAME
    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      rm $PIDFILE
    1.57      sleep 2
    1.58      $DAEMON $OPTIONS
    1.59      status
    1.60      ;;
    1.61    *)
    1.62 -    echo ""
    1.63 -    echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]"
    1.64 -    echo ""
    1.65 +    emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]"
    1.66 +    newline
    1.67      exit 1
    1.68      ;;
    1.69  esac