From: Martin Schwenke Date: Thu, 8 Feb 2018 01:18:56 +0000 (+1100) Subject: ctdb-tests: New function setup_script_options() X-Git-Tag: talloc-2.1.13~144 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3712640d47d5e8e0b76ed2989779d2aae0ed73f6;p=thirdparty%2Fsamba.git ctdb-tests: New function setup_script_options() Currently exports the variable assignment on each line. Later this can be changed to handle actual per-script configuration. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/tests/eventscripts/scripts/local.sh b/ctdb/tests/eventscripts/scripts/local.sh index 7823b1f1e56..782c6d5bb5f 100644 --- a/ctdb/tests/eventscripts/scripts/local.sh +++ b/ctdb/tests/eventscripts/scripts/local.sh @@ -71,6 +71,18 @@ fi # General setup fakery +# The current implementation just assumes each non-comment line of +# input is a variable assignment and evals it with export prepended. +setup_script_options () +{ + while read line ; do + case "$line" in + \#*|"") : ;; + *) eval "export $line" + esac + done +} + setup_dbdir () { export CTDB_DBDIR="${EVENTSCRIPTS_TESTS_VAR_DIR}/db"