5 # description: Courier IMAP Daemon
7 sysconfdir=@sysconfdir@
8 libexecdir=@libexecdir@
11 # Source function library
12 . /etc/rc.d/init.d/functions
15 . /etc/sysconfig/network
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"
28 # See how we were called.
31 # Check if the service is already running?
32 if [ ! -f /var/lock/subsys/courier-imap ]; then
34 msg_starting "Courier IMAP"
35 daemon $libexecdir/imapd.rc start
37 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/courier-imap
39 msg_already_running "Courier IMAP"
43 if [ -f /var/lock/subsys/courier-imap ]; then
45 msg_stopping "Courier IMAP"
46 daemon $libexecdir/imapd.rc stop
48 rm -f /var/lock/subsys/courier-imap >/dev/null 2>&1
50 msg_not_running "Courier IMAP"
59 # FIXME: matches other services, like courier-imap-ssl
64 msg_usage "$0 {start|stop|restart|force-reload|status}"