eventscripts: stop loadconfig function from loading ctdb config file twice.
authorMartin Schwenke <martin@meltin.net>
Fri, 22 Jan 2010 06:19:12 +0000 (17:19 +1100)
committerMartin Schwenke <martin@meltin.net>
Fri, 22 Jan 2010 06:19:12 +0000 (17:19 +1100)
If "$1" was empty than loadconfig would load the ctdb config twice.
This stops that from happening.

Signed-off-by: Martin Schwenke <martin@meltin.net>
config/functions

index 32d6d98ac54941dda4989272c668741f7145dd5d..531f85937db3a3237536d995feac6d95eb6b4ec9 100644 (file)
@@ -6,17 +6,16 @@ PATH=/bin:/usr/bin:/usr/sbin:/sbin:$PATH
 # pull in a system config file, if any
 loadconfig() {
 
-    if [ "$1" != "ctdb" ] ; then
-       loadconfig "ctdb"
-    fi
-
     if [ -z "$1" ] ; then
        foo="${service_config:-${service_name}}"
        if [ -n "$foo" ] ; then
            loadconfig "$foo"
        fi
+    elif [ "$1" != "ctdb" ] ; then
+       loadconfig "ctdb"
     fi
 
+
     if [ -f /etc/sysconfig/$1 ]; then
        . /etc/sysconfig/$1
     elif [ -f /etc/default/$1 ]; then