wok annotate dovecot/stuff/init.d/dovecot @ rev 24689

updated jp2a (1.0.9 -> 1.1.1)
author Hans-G?nter Theisgen
date Sat Mar 12 13:47:37 2022 +0100 (2022-03-12)
parents 7f188676b59c
children
rev   line source
erjo@12043 1 #!/bin/sh
Hans-G?nter@24498 2 # /etc/init.d/dovecot : Start, stop and restart dovecot server on SliTaz,
Hans-G?nter@24498 3 # at boot time or with the command line.
erjo@12043 4 #
Hans-G?nter@24498 5 # To start dovecot server at boot time, just put dovecot in the $RUN_DAEMONS
erjo@12043 6 # variable of /etc/rcS.conf and configure options with /etc/daemons.conf
erjo@12043 7 #
erjo@12043 8 . /etc/init.d/rc.functions
erjo@12043 9 . /etc/daemons.conf
erjo@12043 10
erjo@12043 11 NAME=dovecot
al@19159 12 DESC="$(_ '%s daemon' Dovecot)"
erjo@12043 13 DAEMON=/usr/sbin/dovecot
Hans-G?nter@24498 14 OPTIONS=$DOVECOT_OPTIONS
erjo@12060 15 PIDFILE=/var/run/dovecot/master.pid
erjo@12043 16
Hans-G?nter@24498 17 if [ ! -d /var/run/dovecot ]
Hans-G?nter@24498 18 then
pascal@16681 19 mkdir -p /var/run/dovecot
pascal@16681 20 chown dovecot.dovecot /var/run/dovecot
pascal@16681 21 fi
Hans-G?nter@24498 22
erjo@12043 23 case "$1" in
Hans-G?nter@24498 24 (start)
Hans-G?nter@24498 25 if active_pidfile $PIDFILE dovecot
Hans-G?nter@24498 26 then
Hans-G?nter@24498 27 _ '%s is already running.' $NAME
Hans-G?nter@24498 28 exit 1
Hans-G?nter@24498 29 fi
Hans-G?nter@24498 30 action 'Starting %s: %s...' "$DESC" $NAME
Hans-G?nter@24498 31 $DAEMON $OPTIONS
Hans-G?nter@24498 32 status
Hans-G?nter@24498 33 ;;
Hans-G?nter@24498 34 (stop)
Hans-G?nter@24498 35 if ! active_pidfile $PIDFILE dovecot
Hans-G?nter@24498 36 then
Hans-G?nter@24498 37 _ '%s is not running.' $NAME
Hans-G?nter@24498 38 exit 1
Hans-G?nter@24498 39 fi
Hans-G?nter@24498 40 action 'Stopping %s: %s...' "$DESC" $NAME
Hans-G?nter@24498 41 kill $(cat $PIDFILE)
Hans-G?nter@24498 42 status
Hans-G?nter@24498 43 ;;
Hans-G?nter@24498 44 (restart)
Hans-G?nter@24498 45 if ! active_pidfile $PIDFILE dovecot
Hans-G?nter@24498 46 then
Hans-G?nter@24498 47 _ '%s is not running.' $NAME
Hans-G?nter@24498 48 exit 1
Hans-G?nter@24498 49 fi
Hans-G?nter@24498 50 action 'Restarting %s: %s...' "$DESC" $NAME
Hans-G?nter@24498 51 kill $(cat $PIDFILE)
Hans-G?nter@24498 52 sleep 2
Hans-G?nter@24498 53 $DAEMON $OPTIONS
Hans-G?nter@24498 54 status
Hans-G?nter@24498 55 ;;
Hans-G?nter@24498 56 (*)
Hans-G?nter@24498 57 emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]"
Hans-G?nter@24498 58 newline
Hans-G?nter@24498 59 exit 1
Hans-G?nter@24498 60 ;;
erjo@12043 61 esac
erjo@12043 62
erjo@12043 63 exit 0