wok annotate dovecot/stuff/init.d/dovecot @ rev 15036
Up wesnoth-music (1.10.3)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Mon Aug 12 12:29:55 2013 +0000 (2013-08-12) |
parents | d635a5200162 |
children | 0d8a1a3edc72 |
rev | line source |
---|---|
erjo@12043 | 1 #!/bin/sh |
erjo@12043 | 2 # /etc/init.d/dovecot : Start, stop and restart Dovecotserver on SliTaz, at |
erjo@12043 | 3 # boot time or with the command line. |
erjo@12043 | 4 # |
erjo@12043 | 5 # To start SSH 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 |
erjo@12043 | 12 DESC="Dovecot daemon" |
erjo@12043 | 13 DAEMON=/usr/sbin/dovecot |
erjo@12043 | 14 OPTIONS=$dovecot_OPTIONS |
erjo@12060 | 15 PIDFILE=/var/run/dovecot/master.pid |
erjo@12043 | 16 |
erjo@12043 | 17 case "$1" in |
erjo@12043 | 18 start) |
erjo@12043 | 19 if active_pidfile $PIDFILE dovecot ; then |
erjo@12043 | 20 echo "$NAME already running." |
erjo@12043 | 21 exit 1 |
erjo@12043 | 22 fi |
erjo@12043 | 23 echo -n "Starting $DESC: $NAME... " |
erjo@12043 | 24 $DAEMON $OPTIONS |
erjo@12043 | 25 status |
erjo@12043 | 26 ;; |
erjo@12043 | 27 stop) |
erjo@12043 | 28 if ! active_pidfile $PIDFILE dovecot ; then |
erjo@12043 | 29 echo "$NAME is not running." |
erjo@12043 | 30 exit 1 |
erjo@12043 | 31 fi |
erjo@12043 | 32 echo -n "Stopping $DESC: $NAME... " |
erjo@12043 | 33 kill `cat $PIDFILE` |
erjo@12043 | 34 status |
erjo@12043 | 35 ;; |
erjo@12043 | 36 restart) |
erjo@12043 | 37 if ! active_pidfile $PIDFILE dovecot ; then |
erjo@12043 | 38 echo "$NAME is not running." |
erjo@12043 | 39 exit 1 |
erjo@12043 | 40 fi |
erjo@12043 | 41 echo -n "Restarting $DESC: $NAME... " |
erjo@12043 | 42 kill `cat $PIDFILE` |
erjo@12043 | 43 sleep 2 |
erjo@12043 | 44 $DAEMON $OPTIONS |
erjo@12043 | 45 status |
erjo@12043 | 46 ;; |
erjo@12043 | 47 *) |
erjo@12043 | 48 echo "" |
erjo@12043 | 49 echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]" |
erjo@12043 | 50 echo "" |
erjo@12043 | 51 exit 1 |
erjo@12043 | 52 ;; |
erjo@12043 | 53 esac |
erjo@12043 | 54 |
erjo@12043 | 55 exit 0 |