packages: dhcp/dhcp6.init - run checkconfig only once (it trashes syslog n...

glen glen at pld-linux.org
Thu Nov 19 21:34:00 CET 2009


Author: glen                         Date: Thu Nov 19 20:34:00 2009 GMT
Module: packages                      Tag: HEAD
---- Log message:

- run checkconfig only once (it trashes syslog no matter what, so do it at least once then)

---- Files affected:
packages/dhcp:
   dhcp6.init (1.5 -> 1.6) 

---- Diffs:

================================================================
Index: packages/dhcp/dhcp6.init
diff -u packages/dhcp/dhcp6.init:1.5 packages/dhcp/dhcp6.init:1.6
--- packages/dhcp/dhcp6.init:1.5	Thu Nov 19 21:27:53 2009
+++ packages/dhcp/dhcp6.init	Thu Nov 19 21:33:55 2009
@@ -50,16 +50,22 @@
 }
 
 # wrapper for configtest
+checkconfig=-1
 checkconfig() {
 	local details=${1:-0}
 
+	# run checkconfig only once
+	if [ "$checkconfig" != -1 ]; then
+		return $checkconfig
+	fi
+
 	if [ $details = 1 ]; then
 		# run config test and display report (status action)
 		show "Checking %s configuration" "DHCP IPv6 Server"; busy
 		local out
 		out=$(configtest 2>&1)
-		RETVAL=$?
-		if [ $RETVAL = 0 ]; then
+		checkconfig=$?
+		if [ $checkconfig = 0 ]; then
 			ok
 		else
 			fail
@@ -69,11 +75,11 @@
 		# run config test and abort with nice message if failed
 		# (for actions checking status before action).
 		configtest >/dev/null 2>&1
-		RETVAL=$?
-		if [ $RETVAL != 0 ]; then
+		checkconfig=$?
+		if [ $checkconfig != 0 ]; then
 			show "Checking %s configuration" "DHCP IPv6 Server"; fail
 			nls 'Configuration test failed. See details with %s "checkconfig"' $0
-			exit $RETVAL
+			exit $checkconfig
 		fi
 	fi
 }
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/dhcp/dhcp6.init?r1=1.5&r2=1.6&f=u



More information about the pld-cvs-commit mailing list