wok diff postgrey/stuff/etc/init.d/postgrey @ rev 22649

updated djview (4.10.3 -> 4.10.6)
author Hans-G?nter Theisgen
date Tue Jan 14 13:39:45 2020 +0100 (2020-01-14)
parents ce2d65bd0418
children
line diff
     1.1 --- a/postgrey/stuff/etc/init.d/postgrey	Mon Aug 10 14:09:59 2009 +0200
     1.2 +++ b/postgrey/stuff/etc/init.d/postgrey	Tue Jan 14 13:39:45 2020 +0100
     1.3 @@ -1,5 +1,5 @@
     1.4  #!/bin/sh
     1.5 -# /etc/init.d/postgrey : Start, stop and restart Grey list server on SliTaz, at 
     1.6 +# /etc/init.d/postgrey : Start, stop and restart Grey list server on SliTaz, at
     1.7  # boot time or with the command line.
     1.8  #
     1.9  # To start Grey list server at boot time, just put postgrey in the $RUN_DAEMONS
    1.10 @@ -9,7 +9,7 @@
    1.11  . /etc/daemons.conf
    1.12  
    1.13  NAME=Postgrey
    1.14 -DESC="Grey list server"
    1.15 +DESC="$(_ 'Postfix Greylisting Policy Server')"
    1.16  DAEMON=/usr/bin/postgrey
    1.17  OPTIONS=$POSTGREY_OPTIONS
    1.18  PIDFILE=/var/run/postgrey.pid
    1.19 @@ -18,11 +18,11 @@
    1.20  case "$1" in
    1.21    start)
    1.22      if active_pidfile $PIDFILE postgrey ; then
    1.23 -      echo "$NAME already running."
    1.24 +      _ '%s is already running.' $NAME
    1.25        exit 1
    1.26      fi
    1.27      if ! grep -q ^smtpd_recipient_restrictions /etc/postfix/main.cf; then
    1.28 -      echo -n "Updating /etc/postfix/main.cf"
    1.29 +      _ 'Updating %s' '/etc/postfix/main.cf'
    1.30        cat >> /etc/postfix/main.cf <<EOF
    1.31  
    1.32  # Add by $0
    1.33 @@ -33,34 +33,33 @@
    1.34  EOF
    1.35        /etc/init.d/postfix reload
    1.36      fi
    1.37 -    echo -n "Starting $DESC: $NAME... "
    1.38 +    action 'Starting %s: %s...' "$DESC" $NAME
    1.39      $DAEMON $OPTIONS
    1.40      status
    1.41      ;;
    1.42    stop)
    1.43      if ! active_pidfile $PIDFILE postgrey ; then
    1.44 -      echo "$NAME is not running."
    1.45 +      _ '%s is not running.' $NAME
    1.46        exit 1
    1.47      fi
    1.48 -    echo -n "Stopping $DESC: $NAME... "
    1.49 -    kill `cat $PIDFILE`
    1.50 +    action 'Stopping %s: %s...' "$DESC" $NAME
    1.51 +    kill $(cat $PIDFILE)
    1.52      status
    1.53      ;;
    1.54    restart)
    1.55      if ! active_pidfile $PIDFILE postgrey ; then
    1.56 -      echo "$NAME is not running."
    1.57 +      _ '%s is not running.' $NAME
    1.58        exit 1
    1.59      fi
    1.60 -    echo -n "Restarting $DESC: $NAME... "
    1.61 -    kill `cat $PIDFILE`
    1.62 +    action 'Restarting %s: %s...' "$DESC" $NAME
    1.63 +    kill $(cat $PIDFILE)
    1.64      sleep 2
    1.65      $DAEMON $OPTIONS
    1.66      status
    1.67      ;;
    1.68    *)
    1.69 -    echo ""
    1.70 -    echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart|reload]"
    1.71 -    echo ""
    1.72 +    emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]"
    1.73 +    newline
    1.74      exit 1
    1.75      ;;
    1.76  esac