#!/bin/sh # POP3 SSL Daemon # # chkconfig: 345 80 20 # description: POP3 SSL Daemon sysconfdir=@sysconfdir@ libexecdir=@libexecdir@ sbindir=@sbindir@ # Source function library . /etc/rc.d/init.d/functions # Get network config . /etc/sysconfig/network # Check that networking is up. if is_yes "${NETWORKING}"; then if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then msg_network_down pop3d-ssl exit 1 fi else exit 0 fi RETVAL=0 # See how we were called. case "$1" in start) # Check if the service is already running? if [ ! -f /var/lock/subsys/courier-pop3-ssl ]; then if [ -x "$COURIERTLS" -a ! -f "$TLS_CERTFILE" ]; then msg_starting "pop3d-ssl cert generation" daemon $sbindir/mkpop3dcert fi msg_starting pop3d-ssl daemon $libexecdir/pop3d-ssl.rc start RETVAL=$? [ $RETVAL -eq 0 ] && touch /var/lock/subsys/courier-pop3-ssl else msg_already_running pop3d-ssl fi ;; stop) if [ -f /var/lock/subsys/courier-pop3-ssl ]; then msg_stopping pop3d-ssl daemon $libexecdir/pop3d-ssl.rc stop RETVAL=$? rm -f /var/lock/subsys/courier-pop3-ssl >/dev/null 2>&1 else msg_not_running pop3d-ssl fi ;; restart|force-reload) $0 stop $0 start exit $? ;; status) status couriertcpd exit $? ;; *) msg_usage "$0 {start|stop|restart|force-reload|status}" exit 3 esac exit $RETVAL