wok diff openldap/stuff/etc/init.d/openldap @ rev 20257

Add giflossy
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Mar 13 23:27:32 2018 +0100 (2018-03-13)
parents 97a1415c2ffa
children
line diff
     1.1 --- a/openldap/stuff/etc/init.d/openldap	Sun Oct 21 15:39:23 2012 +0200
     1.2 +++ b/openldap/stuff/etc/init.d/openldap	Tue Mar 13 23:27:32 2018 +0100
     1.3 @@ -1,5 +1,5 @@
     1.4  #!/bin/sh
     1.5 -# /etc/init.d/openldap : Start, stop and restart LDAP server on SliTaz, at 
     1.6 +# /etc/init.d/openldap : Start, stop and restart LDAP server on SliTaz, at
     1.7  # boot time or with the command line.
     1.8  #
     1.9  # To start LDAP server at boot time, just put openldap in the $RUN_DAEMONS
    1.10 @@ -9,7 +9,7 @@
    1.11  . /etc/daemons.conf
    1.12  
    1.13  NAME=Openldap
    1.14 -DESC="LDAP server"
    1.15 +DESC="$(_ '%s server' LDAP)"
    1.16  DAEMON=/usr/lib/openldap/slapd
    1.17  OPTIONS=$LDAP_OPTIONS
    1.18  PIDFILE=/var/lib/openldap/run/slapd.pid
    1.19 @@ -17,43 +17,42 @@
    1.20  case "$1" in
    1.21    start)
    1.22      if active_pidfile $PIDFILE slapd ; 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 +    action 'Starting %s: %s...' "$DESC" $NAME
    1.29      $DAEMON $OPTIONS && sleep 2
    1.30      status
    1.31      for i in /etc/ldap.d/* ; do
    1.32 -      	[ -x $i ] || continue
    1.33 -      	echo -n "Running $i..."
    1.34 -      	$i
    1.35 -      	status
    1.36 +      [ -x $i ] || continue
    1.37 +      action 'Running %s...' $i
    1.38 +      $i
    1.39 +      status
    1.40      done
    1.41      ;;
    1.42    stop)
    1.43      if ! active_pidfile $PIDFILE slapd ; 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 slapd ; 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 && sleep 2
    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]"
    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