5 # description: IMAP SSL 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 imapd-ssl
28 # See how we were called.
31 # Check if the service is already running?
32 if [ ! -f /var/lock/subsys/courier-imap-ssl ]; then
33 if [ -x "$COURIERTLS" -a ! -f "$TLS_CERTFILE" ]; then
34 msg_starting "imapd-ssl cert generation"
35 daemon $sbindir/mkimapdcert
37 . $sysconfdir/imapd-ssl
38 msg_starting imapd-ssl
39 daemon $libexecdir/imapd-ssl.rc start
41 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/courier-imap-ssl
43 msg_already_running imapd-ssl
47 if [ -f /var/lock/subsys/courier-imap-ssl ]; then
48 . $sysconfdir/imapd-ssl
49 msg_stopping imapd-ssl
50 daemon $libexecdir/imapd-ssl.rc stop
52 rm -f /var/lock/subsys/courier-imap-ssl >/dev/null 2>&1
54 msg_not_running imapd-ssl
67 msg_usage "$0 {start|stop|restart|force-reload|status}"