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
18 [ -f /etc/sysconfig/courier-imap ] && . /etc/sysconfig/courier-imap
20 # Check that networking is up.
21 if is_yes "${NETWORKING}"; then
22 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
23 msg_network_down "Courier IMAP"
31 # Check if the service is already running?
32 if [ -f /var/lock/subsys/courier-imap ]; then
33 msg_already_running "Courier IMAP"
37 msg_starting "Courier IMAP"
38 daemon $libexecdir/imapd.rc start
40 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/courier-imap
44 if [ ! -f /var/lock/subsys/courier-imap ]; then
45 msg_not_running "Courier IMAP"
49 msg_stopping "Courier IMAP"
50 daemon $libexecdir/imapd.rc stop
52 rm -f /var/lock/subsys/courier-imap >/dev/null 2>&1
56 if [ ! -f /var/lock/subsys/courier-imap ]; then
57 msg_not_running "Courier IMAP"
67 # See how we were called.
83 # FIXME: matches other services, like courier-imap-ssl
88 msg_usage "$0 {start|stop|restart|force-reload|status}"