]> git.pld-linux.org Git - packages/stunnel.git/blobdiff - stunnel.init
- log service name which was refused too ( -libwrap_srv_name_log.patch).
[packages/stunnel.git] / stunnel.init
index ca1d2c9b2db9bccf2e12f100ed9d13a8787c825c..6d202b3308a119165374b7e74e0e08be8eaa59e8 100644 (file)
@@ -2,7 +2,7 @@
 #
 # 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 -a "$1" != stop -a "$1" != status ]; 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
 
+RETVAL=0
 # See how we were called.
 case "$1" in
   start)
@@ -38,33 +43,32 @@ case "$1" in
                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
                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|force-reload)
        $0 stop
        $0 start
+       exit $?
        ;;
   status)
        status stunnel
        exit $?
        ;;
   *)
-       msg_usage "$0 {start|stop|status|restart}"
-       exit 1
+       msg_usage "$0 {start|stop|restart|force-reload|status}"
+       exit 3
 esac
 
 exit $RETVAL
This page took 0.08232 seconds and 4 git commands to generate.