wok diff c_icap/stuff/c-icapd @ rev 19980

Up kriss_feed (8.7)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Jun 15 08:14:05 2017 +0200 (2017-06-15)
parents 0d8a1a3edc72
children
line diff
     1.1 --- a/c_icap/stuff/c-icapd	Sun May 18 20:24:07 2014 +0000
     1.2 +++ b/c_icap/stuff/c-icapd	Thu Jun 15 08:14:05 2017 +0200
     1.3 @@ -1,5 +1,5 @@
     1.4  #!/bin/sh
     1.5 -# /etc/init.d/nagios : Start, stop and restart ICAP server on SliTaz, at 
     1.6 +# /etc/init.d/nagios : Start, stop and restart ICAP server on SliTaz, at
     1.7  # boot time or with the command line.
     1.8  #
     1.9  # To start ICAP server at boot time, just put c-icapd in the $RUN_DAEMONS
    1.10 @@ -9,7 +9,7 @@
    1.11  . /etc/daemons.conf
    1.12  
    1.13  NAME=c-icap
    1.14 -DESC="ICAP Server"
    1.15 +DESC="$(_ '%s server' ICAP)"
    1.16  DAEMON=/usr/bin/c-icap
    1.17  OPTIONS=""
    1.18  PIDFILE=/var/run/c-icap/c-icap.pid
    1.19 @@ -18,39 +18,38 @@
    1.20  case "$1" in
    1.21    start)
    1.22      if active_pidfile $PIDFILE $NAME ; 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 $NAME ; 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      status
    1.44      ;;
    1.45    restart|reload)
    1.46      if ! active_pidfile $PIDFILE $NAME ; 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 "Restarting $DESC: $NAME... "
    1.52 -    kill `cat $PIDFILE`
    1.53 +    action 'Restarting %s: %s...' "$DESC" $NAME
    1.54 +    kill $(cat $PIDFILE)
    1.55      sleep 2
    1.56      $DAEMON $OPTIONS
    1.57      status
    1.58      ;;
    1.59    test)
    1.60 -	configtest ;;
    1.61 +    configtest ;;
    1.62    *)
    1.63 -    echo ""
    1.64 -    echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart|reload]"
    1.65 -    echo ""
    1.66 +    emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart|reload|test]"
    1.67 +    newline
    1.68      exit 1
    1.69      ;;
    1.70  esac