#!/bin/sh # IMAP Auth Daemon # # chkconfig: 345 80 20 # description: IMAP Auth Daemon # Source function library . /etc/rc.d/init.d/functions # Get network config . /etc/sysconfig/network METHOD="plain" [ -f /etc/sysconfig/authdaemon ] && . /etc/sysconfig/authdaemon # Check that networking is up. if is_no "${NETWORKING}" ; then msg_Network_Down "Courier IMAP - Authdaemon" exit 1 fi # See how we were called. case "$1" in start) # Check if the service is already running? if [ ! -f /var/lock/subsys/authdaemon ]; then msg_starting "Courier IMAP - Authdaemon" daemon /usr/lib/courier-imap/authlib/authdaemond.$METHOD start RETVAL=$? [ $RETVAL -eq 0 ] && touch /var/lock/subsys/authdaemon else msg_Already_Running "Courier IMAP - Authdaemon" exit 1 fi ;; stop) if [ -f /var/lock/subsys/authdaemon ]; then msg_stopping "Courier IMAP - Authdaemon" daemon /usr/lib/courier-imap/authlib/authdaemond.$METHOD stop RETVAL=$? rm -f /var/lock/subsys/authdaemon else msg_not_running "Courier IMAP - Authdaemon" exit 1 fi ;; restart|reload) $0 stop $0 start ;; status) status authdaemond.$METHOD ;; *) msg_Usage "$0 {start|stop|restart|reload|status}" exit 1 esac exit $RETVAL