#!/sbin/runscript # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/net-misc/stunnel/files/stunnel.rc6.4.09,v 1.1 2005/05/13 21:45:29 ramereth Exp $ # Default pidfile location PIDFILE="/var/run/stunnel/stunnel.pid" checkconfig() { # To ensure backwards compatibility if [ ! -z "$(egrep '/etc/stunnel/stunnel.pid' /etc/stunnel/stunnel.conf)" ] ; then ewarn "Please update your stunnel.conf!" ewarn "pid should point to /var/run/stunnel/stunnel.pid" PIDFILE="/etc/stunnel/stunnel.pid" fi } depend() { need net } start() { checkconfig ebegin "Starting stunnel" start-stop-daemon --start --pidfile ${PIDFILE} --quiet --exec /usr/sbin/stunnel -- /etc/stunnel/stunnel.conf eend $? } stop() { checkconfig ebegin "Stopping stunnel" start-stop-daemon --stop --quiet --pidfile ${PIDFILE} eend $? }