#
# stunnel stunnel (Universal SSL tunnel)
#
-# chkconfig: 345 14 91
+# chkconfig: 345 14 91
#
# description: stunnel (Universal SSL tunnel)
#
[ -f /etc/sysconfig/stunnel ] && . /etc/sysconfig/stunnel
# Check that networking is up.
-if is_no "${NETWORKING}"; then
- msg_network_down stunnel
- exit 1
+if is_yes "${NETWORKING}"; then
+ if [ ! -f /var/lock/subsys/network ]; then
+ msg_network_down stunnel
+ exit 1
+ fi
+else
+ exit 0
fi
# Daemon doesn't die if config doesn't exist
-if [ ! -f $STUNNEL_CONFIG ]; then
- echo "Stunnel config $STUNNEL_CONFIG does not exist."
+if [ ! -f "$STUNNEL_CONFIG" ]; then
+ nls "%s config %s does not exist." Stunnel "$STUNNEL_CONFIG"
exit 1
fi
+
# See how we were called.
case "$1" in
start)
msg_starting stunnel; busy
daemon stunnel $STUNNEL_CONFIG
RETVAL=$?
- [ $RETVAL -eq 0 ] && touch /var/lock/subsys/stunnel
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/stunnel
else
msg_already_running stunnel
exit 1
fi
;;
stop)
- if [ -f /var/lock/subsys/stunnel ]; then
+ if [ -f /var/lock/subsys/stunnel ]; then
msg_stopping stunnel
killproc stunnel
+ RETVAL=$?
rm -f /var/run/stunnel/stunnel.pid /var/lock/subsys/stunnel >/dev/null 2>&1
else
msg_not_running stunnel
exit 1
fi
;;
- restart)
+ restart|reload)
$0 stop
$0 start
+ exit $?
+ ;;
+ force-reload)
+ $0 stop && $0 start
+ exit $?
;;
status)
status stunnel
exit $?
;;
*)
- msg_usage "$0 {start|stop|status|restart}"
+ msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
exit 1
esac