#!/sbin/runscript # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/net-mail/cyrus-imspd/files/imspd.rc6,v 1.3 2004/07/14 23:49:25 agriffis Exp $ depend() { need net use dns logger after saslauthd } use_ssl() { if [ "${IMSPD_USE_SSL}" = "yes" -a -x /usr/sbin/stunnel -a -f /etc/stunnel/imspd.conf ] ; then echo "yes" return 0 fi return 1 } start() { ebegin "Starting cyrus imspd" start-stop-daemon --start --quiet --background --make-pidfile \ --pidfile /var/run/imspd.pid --exec /usr/sbin/imspd eend $? if [ -n "`use_ssl`" ] ; then ebegin "Starting cyrus imspd ssl tunnel" start-stop-daemon --start --quiet --exec /usr/sbin/stunnel \ -- /etc/stunnel/imspd.conf eend $? fi } stop() { if [ -n "`use_ssl`" ] ; then ebegin "Stopping cyrus imspd ssl tunnel" start-stop-daemon --stop --quiet \ --pidfile /var/run/stunnel.imspd.pid eend $? fi ebegin "Stopping cyrus imspd" start-stop-daemon --stop --quiet --pidfile /var/run/imspd.pid eend $? }