summaryrefslogtreecommitdiff
path: root/ctdb
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2019-03-20 21:19:49 +1100
committerKarolin Seeger <kseeger@samba.org>2019-04-12 07:57:11 +0000
commitdae0e8ec961dc96e2d75c9b5e7d1c47479a9c1e4 (patch)
treeb3e8f24e4ebbd018c2ac30e3475beb3c49320576 /ctdb
parent14069988a97ce9f32f10e8e851b6739083dc52ff (diff)
downloadsamba-dae0e8ec961dc96e2d75c9b5e7d1c47479a9c1e4.tar.gz
ctdb-scripts: Allow load_system_config() to take multiple alternatives
The situation for NFS config has got more complicated and is probably broken in statd-callout on Debian-like systems at the moment. Allow several alternative configuration names to be tried. Stop after the first that is found and loaded. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13860 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@samba.org> (cherry picked from commit 0d67ea5fcca766734ecc73ad6b0139f7c13a15c5)
Diffstat (limited to 'ctdb')
-rwxr-xr-xctdb/config/functions19
1 files changed, 10 insertions, 9 deletions
diff --git a/ctdb/config/functions b/ctdb/config/functions
index 7a47c9d8e79..1dc16532890 100755
--- a/ctdb/config/functions
+++ b/ctdb/config/functions
@@ -33,15 +33,16 @@ fi
load_system_config ()
{
- if [ -z "$1" ] ; then
- return
- fi
-
- if [ -f "${CTDB_SYS_ETCDIR}/sysconfig/$1" ]; then
- . "${CTDB_SYS_ETCDIR}/sysconfig/$1"
- elif [ -f "${CTDB_SYS_ETCDIR}/default/$1" ]; then
- . "${CTDB_SYS_ETCDIR}/default/$1"
- fi
+ for _i ; do
+
+ if [ -f "${CTDB_SYS_ETCDIR}/sysconfig/${_i}" ]; then
+ . "${CTDB_SYS_ETCDIR}/sysconfig/${_i}"
+ return
+ elif [ -f "${CTDB_SYS_ETCDIR}/default/${_i}" ]; then
+ . "${CTDB_SYS_ETCDIR}/default/${_i}"
+ return
+ fi
+ done
}
# load_script_options [ component script ]