SOURCES: openvpn.init - exit early if no tunnels configured

glen glen at pld-linux.org
Thu Dec 7 19:27:28 CET 2006


Author: glen                         Date: Thu Dec  7 18:27:28 2006 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- exit early if no tunnels configured

---- Files affected:
SOURCES:
   openvpn.init (1.28 -> 1.29) 

---- Diffs:

================================================================
Index: SOURCES/openvpn.init
diff -u SOURCES/openvpn.init:1.28 SOURCES/openvpn.init:1.29
--- SOURCES/openvpn.init:1.28	Wed Nov  1 00:15:40 2006
+++ SOURCES/openvpn.init	Thu Dec  7 19:27:23 2006
@@ -8,6 +8,20 @@
 #		Private Network) daemon
 #
 
+# Get service config
+[ -f /etc/sysconfig/openvpn ] && . /etc/sysconfig/openvpn
+
+[ -n "$2" ] && TUNNELS="$2"
+
+# no tunnels. exit silently
+if [ -z "$TUNNELS" ]; then
+   	case "$1" in
+	start|stop|restart|reload|force-reload)
+		exit 0
+		;;
+	esac
+fi
+
 # Source function library
 . /etc/rc.d/init.d/functions
 
@@ -24,11 +38,6 @@
 	exit 0
 fi
 
-# Get service config
-[ -f /etc/sysconfig/openvpn ] && . /etc/sysconfig/openvpn
-
-[ -n "$2" ] && TUNNELS="$2"
-
 # check if all the tunnel $1 is up
 tunlup() {
 	local tun="$1"
@@ -49,11 +58,6 @@
 }
 
 start() {
-	if [ -z "$TUNNELS" ]; then
-		nls "No tunnels configured in /etc/sysconfig/openvpn"
-		exit 6
-	fi
-
 	# Check if the service is already running?
 	if ! tunlsup; then
 		msg_starting "OpenVPN"; started
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/openvpn.init?r1=1.28&r2=1.29&f=u



More information about the pld-cvs-commit mailing list