1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-05 20:58:40 +03:00

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)
This commit is contained in:
Martin Schwenke 2019-03-20 21:19:49 +11:00 committed by Karolin Seeger
parent 14069988a9
commit dae0e8ec96

View File

@ -33,15 +33,16 @@ fi
load_system_config ()
{
if [ -z "$1" ] ; then
return
fi
for _i ; do
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
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 ]