5 # description: IMAP Auth Daemon
7 # Source function library
8 . /etc/rc.d/init.d/functions
11 . /etc/sysconfig/network
15 [ -f /etc/sysconfig/authdaemon ] && . /etc/sysconfig/authdaemon
17 # Check that networking is up.
18 if is_yes "${NETWORKING}"; then
19 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
20 msg_network_down "Courier IMAP - Authdaemon"
28 # See how we were called.
31 # Check if the service is already running?
32 if [ ! -f /var/lock/subsys/authdaemon ]; then
33 msg_starting "Courier IMAP - Authdaemon"
34 daemon /usr/lib/courier-imap/authlib/authdaemond.$METHOD start
36 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/authdaemon
38 msg_already_running "Courier IMAP - Authdaemon"
42 if [ -f /var/lock/subsys/authdaemon ]; then
43 msg_stopping "Courier IMAP - Authdaemon"
44 daemon /usr/lib/courier-imap/authlib/authdaemond.$METHOD stop
45 rm -f /var/lock/subsys/authdaemon
47 msg_not_running "Courier IMAP - Authdaemon"
51 # restart related services, if running..
52 if [ -f /var/lock/subsys/courier-mta -a \
53 -x /etc/rc.d/init.d/courier-mta ]; then
54 /etc/rc.d/init.d/courier-mta stop
57 if [ -f /var/lock/subsys/courier-imap -a \
58 -x /etc/rc.d/init.d/courier-imap ]; then
59 /etc/rc.d/init.d/courier-imap stop
62 if [ -f /var/lock/subsys/courier-pop3 -a \
63 -x /etc/rc.d/init.d/courier-pop3 ]; then
64 /etc/rc.d/init.d/courier-pop3 stop
70 [ "$imaprun" -eq 1 ] && /etc/rc.d/init.d/courier-imap start
71 [ "$poprun" -eq 1 ] && /etc/rc.d/init.d/courier-pop3 start
72 [ "$crun" -eq 1 ] && /etc/rc.d/init.d/courier-mta start
78 status authdaemond.$METHOD
82 msg_usage "$0 {start|stop|restart|force-reload|status}"