wok diff dovecot/stuff/init.d/dovecot @ rev 24988

Fix perl-gd & tcptrack
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu May 12 11:01:25 2022 +0000 (2022-05-12)
parents 7f188676b59c
children
line diff
     1.1 --- a/dovecot/stuff/init.d/dovecot	Thu May 26 20:16:45 2016 +0300
     1.2 +++ b/dovecot/stuff/init.d/dovecot	Thu May 12 11:01:25 2022 +0000
     1.3 @@ -1,8 +1,8 @@
     1.4  #!/bin/sh
     1.5 -# /etc/init.d/dovecot : Start, stop and restart Dovecotserver on SliTaz, at
     1.6 -# boot time or with the command line.
     1.7 +# /etc/init.d/dovecot : Start, stop and restart dovecot server on SliTaz,
     1.8 +# at boot time or with the command line.
     1.9  #
    1.10 -# To start SSH server at boot time, just put dovecot in the $RUN_DAEMONS
    1.11 +# To start dovecot server at boot time, just put dovecot in the $RUN_DAEMONS
    1.12  # variable of /etc/rcS.conf and configure options with /etc/daemons.conf
    1.13  #
    1.14  . /etc/init.d/rc.functions
    1.15 @@ -11,48 +11,53 @@
    1.16  NAME=dovecot
    1.17  DESC="$(_ '%s daemon' Dovecot)"
    1.18  DAEMON=/usr/sbin/dovecot
    1.19 -OPTIONS=$dovecot_OPTIONS
    1.20 +OPTIONS=$DOVECOT_OPTIONS
    1.21  PIDFILE=/var/run/dovecot/master.pid
    1.22  
    1.23 -if [ ! -d /var/run/dovecot ]; then
    1.24 +if [ ! -d /var/run/dovecot ]
    1.25 +  then
    1.26  	mkdir -p /var/run/dovecot
    1.27  	chown dovecot.dovecot /var/run/dovecot
    1.28  fi
    1.29 +
    1.30  case "$1" in
    1.31 -  start)
    1.32 -    if active_pidfile $PIDFILE dovecot ; then
    1.33 -      _ '%s is already running.' $NAME
    1.34 -      exit 1
    1.35 -    fi
    1.36 -    action 'Starting %s: %s...' "$DESC" $NAME
    1.37 -    $DAEMON $OPTIONS
    1.38 -    status
    1.39 -    ;;
    1.40 -  stop)
    1.41 -    if ! active_pidfile $PIDFILE dovecot ; then
    1.42 -      _ '%s is not running.' $NAME
    1.43 -      exit 1
    1.44 -    fi
    1.45 -    action 'Stopping %s: %s...' "$DESC" $NAME
    1.46 -    kill $(cat $PIDFILE)
    1.47 -    status
    1.48 -    ;;
    1.49 -  restart)
    1.50 -    if ! active_pidfile $PIDFILE dovecot ; then
    1.51 -      _ '%s is not running.' $NAME
    1.52 -      exit 1
    1.53 -    fi
    1.54 -    action 'Restarting %s: %s...' "$DESC" $NAME
    1.55 -    kill $(cat $PIDFILE)
    1.56 -    sleep 2
    1.57 -    $DAEMON $OPTIONS
    1.58 -    status
    1.59 -    ;;
    1.60 -  *)
    1.61 -    emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]"
    1.62 -    newline
    1.63 -    exit 1
    1.64 -    ;;
    1.65 +	(start)
    1.66 +		if active_pidfile $PIDFILE dovecot
    1.67 +		  then
    1.68 +			_ '%s is already running.' $NAME
    1.69 +			exit 1
    1.70 +		fi
    1.71 +		action 'Starting %s: %s...' "$DESC" $NAME
    1.72 +		$DAEMON $OPTIONS
    1.73 +		status
    1.74 +		;;
    1.75 +	(stop)
    1.76 +		if ! active_pidfile $PIDFILE dovecot
    1.77 +		  then
    1.78 +			_ '%s is not running.' $NAME
    1.79 +			exit 1
    1.80 +		fi
    1.81 +		action 'Stopping %s: %s...' "$DESC" $NAME
    1.82 +		kill $(cat $PIDFILE)
    1.83 +		status
    1.84 +		;;
    1.85 +	(restart)
    1.86 +		if ! active_pidfile $PIDFILE dovecot
    1.87 +		  then
    1.88 +			_ '%s is not running.' $NAME
    1.89 +			exit 1
    1.90 +		fi
    1.91 +		action 'Restarting %s: %s...' "$DESC" $NAME
    1.92 +		kill $(cat $PIDFILE)
    1.93 +		sleep 2
    1.94 +		$DAEMON $OPTIONS
    1.95 +		status
    1.96 +		;;
    1.97 +	(*)
    1.98 +		emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]"
    1.99 +		newline
   1.100 +		exit 1
   1.101 +		;;
   1.102  esac
   1.103  
   1.104  exit 0