Skip to content
Snippets Groups Projects

Add param for cfgfile

Merged Hahn Axel (hahn) requested to merge add-param-for-cfgfile into master
2 files
+ 102
58
Compare changes
  • Side-by-side
  • Inline

Files

+ 23
11
@@ -13,12 +13,11 @@
# - use puppet facts
# - UniBe network and group names - see hostCreate()
#
# ----------------------------------------------------------------------
# ah = axel.hahn@iml.unibe.ch
# 2022-02-16 v0.2 ah add --cfg param
# ======================================================================
. `dirname $0`/inc_getconfig.sh
. `dirname $0`/inc_functions.sh
. `dirname $0`/inc/rest-api-client.sh
tmpfile=/tmp/outcurl.tmp
tmpfile2=/tmp/outcurl2.tmp
@@ -733,6 +732,10 @@ Director actions
Other parameters
--cfg CONFIGFILE
load a costom config file; default: ./inc_getconfig.sh
This must be the 1st parameter to be processed.
--debug
enable debug output.
@@ -761,24 +764,33 @@ echo
echo "##### DIRECTOR HELPER $MY_NAME - $MY_IP"
echo
if [ "$1" = "--cfg" ] && [ -n "$2" ]; then
echo "INFO: loading custom config [$2]..."
. "${2}"
shift 2
else
. "$( dirname $0 )/inc_getconfig.sh"
fi
. `dirname $0`/inc_functions.sh
. `dirname $0`/inc/rest-api-client.sh
if [ $# -eq 0 ]; then
showHelp
exit 0
fi
cd `dirname $0`
ls ./`basename $0` >/dev/null || exit 1
_initVars
# ensure that ./inc_getconfig.sh was loaded
if [ -z "${dir_cfg}" ]; then
echo ERROR: Client is not installed/ configured yet on this machine.
exit 1
fi
if [ $# -eq 0 ]; then
showHelp
exit 0
fi
while [ $# -gt 0 ];
do
case "$1" in
Loading