#!/sbin/runscript # Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # Default pidfile location PIDFILE="/var/run/stunnel/stunnel.pid" checkconfig() { # To ensure backwards compatibility if grep -q /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 --quiet --pidfile "${PIDFILE}" \ --exec /usr/bin/stunnel -- /etc/stunnel/stunnel.conf eend $? } stop() { checkconfig ebegin "Stopping stunnel" start-stop-daemon --stop --quiet --pidfile "${PIDFILE}" eend $? }