]> git.pld-linux.org Git - packages/dhcp.git/commitdiff
- run checkconfig only once (it trashes syslog no matter what, so do it at least...
authorElan Ruusamäe <glen@pld-linux.org>
Thu, 19 Nov 2009 20:33:55 +0000 (20:33 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    dhcp6.init -> 1.6

dhcp6.init

index 469171e9a279efd73d4bae7c3fc95ac493b9d3fa..08a13afebdc79535afadffb104a919e2415ab168 100644 (file)
@@ -50,16 +50,22 @@ configtest() {
 }
 
 # 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 @@ checkconfig() {
                # 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
 }
This page took 0.050155 seconds and 4 git commands to generate.