wok diff privoxy/stuff/daemon-privoxy @ rev 23397

updated perl-test-mockmodule (0.170.0 -> 0.172.0)
author Hans-G?nter Theisgen
date Tue Mar 31 17:19:23 2020 +0100 (2020-03-31)
parents b6858242c35f
children
line diff
     1.1 --- a/privoxy/stuff/daemon-privoxy	Sat Feb 18 17:35:06 2012 +0100
     1.2 +++ b/privoxy/stuff/daemon-privoxy	Tue Mar 31 17:19:23 2020 +0100
     1.3 @@ -1,5 +1,5 @@
     1.4  #!/bin/sh
     1.5 -# /etc/init.d/daemon-name: Start, stop and restart daemon 
     1.6 +# /etc/init.d/daemon-name: Start, stop and restart daemon
     1.7  # on SliTaz, at boot time or with the command line.
     1.8  #
     1.9  # To start daemon at boot time, just put the right name in the $RUN_DAEMONS
    1.10 @@ -9,7 +9,7 @@
    1.11  . /etc/daemons.conf
    1.12  
    1.13  NAME=Privoxy
    1.14 -DESC="Web proxy daemon"
    1.15 +DESC="$(_ 'Web proxy daemon')"
    1.16  DAEMON=/usr/sbin/privoxy
    1.17  OPTIONS="--pidfile /var/run/privoxy.pid"
    1.18  USER="--user privoxy"
    1.19 @@ -19,39 +19,38 @@
    1.20  case "$1" in
    1.21    start)
    1.22      if active_pidfile $PIDFILE privoxy ; 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 $USER $CONFIG 2> /dev/null
    1.29 +    action 'Starting %s: %s...' "$DESC" $NAME
    1.30 +    $DAEMON $OPTIONS $USER $CONFIG 2>/dev/null
    1.31      status
    1.32      ;;
    1.33    stop)
    1.34      if ! active_pidfile $PIDFILE privoxy ; 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 privoxy ; then
    1.48 -      echo "$NAME is not running."
    1.49 +      _ '%s is not running.' $NAME
    1.50        exit 1
    1.51      fi
    1.52 -    kill `cat $PIDFILE`
    1.53 +    kill $(cat $PIDFILE)
    1.54      rm $PIDFILE
    1.55      sleep 2
    1.56 -    echo -n "Restarting $DESC: $NAME... "
    1.57 -    $DAEMON $OPTIONS $USER $CONFIG 2> /dev/null
    1.58 +    action 'Restarting %s: %s...' "$DESC" $NAME
    1.59 +    $DAEMON $OPTIONS $USER $CONFIG 2>/dev/null
    1.60      status
    1.61      ;;
    1.62    *)
    1.63 -    echo ""
    1.64 -    echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]"
    1.65 -    echo ""
    1.66 +    emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]"
    1.67 +    newline
    1.68      exit 1
    1.69      ;;
    1.70  esac