From eec674c972524e149c52304b3a8bb288f94b6015 Mon Sep 17 00:00:00 2001 From: Patrick Van der Veken Date: Tue, 30 Mar 2021 17:42:58 +0200 Subject: [PATCH] Fixed bug for check host routine: do not reset HC_TIME_OUT to 60 by default --- opt/hc/bin/check_health.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/opt/hc/bin/check_health.sh b/opt/hc/bin/check_health.sh index a1f73c9..0585cdf 100755 --- a/opt/hc/bin/check_health.sh +++ b/opt/hc/bin/check_health.sh @@ -38,7 +38,7 @@ # ------------------------- CONFIGURATION starts here ------------------------- # define the version (YYYY-MM-DD) -typeset -r SCRIPT_VERSION="2021-03-28" +typeset -r SCRIPT_VERSION="2021-03-31" # location of parent directory containing KSH functions/HC plugins typeset -r FPATH_PARENT="/opt/hc/lib" # location of custom HC configuration files @@ -115,6 +115,7 @@ typeset HC_REPORT_CACHE_TODAY="" typeset LINUX_DISTRO="" # shellcheck disable=SC2034 typeset LINUX_RELEASE="" +typeset PREVIOUS_HC_TIME_OUT="" typeset ARCHIVE_RC=0 typeset DISABLE_RC=0 typeset ENABLE_RC=0 @@ -1385,6 +1386,7 @@ case ${ARG_ACTION} in # --check-host handling: alternative configuration file, mangle ARG_CONFIG_FILE & HC_TIME_OUT if (( ARG_CHECK_HOST == 1 )) then + PREVIOUS_HC_TIME_OUT=${HC_TIME_OUT} ARG_CONFIG_FILE="" # reset from previous call RUN_CONFIG_FILE=$(grep -i -E -e "^hc:${HC_RUN}:" ${HOST_CONFIG_FILE} 2>/dev/null | cut -f3 -d':') [[ -n "${RUN_CONFIG_FILE}" ]] && ARG_CONFIG_FILE="${CONFIG_DIR}/${RUN_CONFIG_FILE}" @@ -1394,7 +1396,7 @@ case ${ARG_ACTION} in (( RUN_TIME_OUT > HC_TIME_OUT )) && HC_TIME_OUT=${RUN_TIME_OUT} else # reset for next HC - HC_TIME_OUT=60 + HC_TIME_OUT=${PREVIOUS_HC_TIME_OUT} fi fi