Skip to content
Snippets Groups Projects

check inc_getconfig.sh exists and hostname -f

2 files
+ 29
8
Compare changes
  • Side-by-side
  • Inline

Files

+ 14
2
@@ -20,8 +20,11 @@
# 2023-01-22 v0.4 ah fix _bStopOnError; some shellfixes
# 2023-02-17 v0.5 ah add hostnamme into CFGSTORAGE
# 2023-02-17 v0.6 ah remove invalid line in cleanup
# 2023-02-17 v0.7 ah check inc_getconfig.sh exists and hostname -f has a value
# ======================================================================
_version="0.7"
tmpfile=/tmp/outcurl.tmp
tmpfile2=/tmp/outcurl2.tmp
@@ -768,7 +771,7 @@ ENDOFHELP
# ------------------------------------------------------------
echo
echo "##### DIRECTOR HELPER $MY_NAME - $MY_IP"
echo "##### DIRECTOR HELPER v$_version ##### $MY_NAME $MY_IP"
echo
if [ "$1" = "--cfg" ] && [ -n "$2" ]; then
@@ -776,7 +779,12 @@ if [ "$1" = "--cfg" ] && [ -n "$2" ]; then
. "${2}"
shift 2
else
. "$( dirname $0 )/inc_getconfig.sh"
_cfg="$( dirname $0 )/inc_getconfig.sh"
if [ ! -f "$_cfg" ]; then
echo "ERROR: The configuration file $_cfg was not created yet."
exit 1
fi
. "$_cfg"
fi
. $(dirname $0)/inc_functions.sh
. $(dirname $0)/inc/rest-api-client.sh
@@ -791,6 +799,10 @@ cd $(dirname $0) || exit
ls ./$(basename $0) >/dev/null || exit 1
_initVars
if [ -z "$MY_NAME" ]; then
echo "ERROR: hostname is empty. Ensure that the command 'hostname -f' returns a fqdn."
exit 1
fi
# ensure that ./inc_getconfig.sh was loaded
if [ -z "${dir_cfg}" ]; then
Loading