From b8d03a150dbdbd58e10f3666b251aff1d4e8a5ea Mon Sep 17 00:00:00 2001 From: Patrick Van der Veken Date: Wed, 13 Jan 2021 10:50:26 +0100 Subject: [PATCH 1/2] Fix for wrong logic in check_*_file_change --- opt/hc/lib/platform/aix/check_aix_file_change.sh | 5 +++-- opt/hc/lib/platform/hp-ux/check_hpux_file_change.sh | 5 +++-- opt/hc/lib/platform/linux/check_linux_file_change.sh | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/opt/hc/lib/platform/aix/check_aix_file_change.sh b/opt/hc/lib/platform/aix/check_aix_file_change.sh index 46040d4..5172c09 100755 --- a/opt/hc/lib/platform/aix/check_aix_file_change.sh +++ b/opt/hc/lib/platform/aix/check_aix_file_change.sh @@ -30,6 +30,7 @@ # @(#) 2019-03-09: added support for --log-healthy [Patrick Van der Veken] # @(#) 2019-03-16: replace 'which' [Patrick Van der Veken] # @(#) 2020-09-05: fix log_hc call for failed checksum + quote fix [Patrick Van der Veken] +# @(#) 2020-01-13: fix log_hc call (wrong logic) [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -39,7 +40,7 @@ function check_aix_file_change { # ------------------------- CONFIGURATION starts here ------------------------- typeset _CONFIG_FILE="${CONFIG_DIR}/$0.conf" -typeset _VERSION="2020-09-05" # YYYY-MM-DD +typeset _VERSION="2021-01-13" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="Linux" # uname -s match # ------------------------- CONFIGURATION ends here --------------------------- @@ -322,7 +323,7 @@ do fi # bounce failures back and jump to next file - if (( _LOG_HEALTHY > 0 || _STC > 0 )) + if (( _LOG_HEALTHY > 0 && _STC > 0 )) then log_hc "$0" ${_STC} "${_MSG}" continue diff --git a/opt/hc/lib/platform/hp-ux/check_hpux_file_change.sh b/opt/hc/lib/platform/hp-ux/check_hpux_file_change.sh index 79d5773..3e4a61f 100755 --- a/opt/hc/lib/platform/hp-ux/check_hpux_file_change.sh +++ b/opt/hc/lib/platform/hp-ux/check_hpux_file_change.sh @@ -30,6 +30,7 @@ # @(#) 2019-03-09: added support for --log-healthy [Patrick Van der Veken] # @(#) 2019-03-16: replace 'which' [Patrick Van der Veken] # @(#) 2020-09-05: fix log_hc call for failed checksum + quote fix [Patrick Van der Veken] +# @(#) 2020-01-13: fix log_hc call (wrong logic) [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -39,7 +40,7 @@ function check_hpux_file_change { # ------------------------- CONFIGURATION starts here ------------------------- typeset _CONFIG_FILE="${CONFIG_DIR}/$0.conf" -typeset _VERSION="2020-05-20" # YYYY-MM-DD +typeset _VERSION="2021-01-13" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="HP-UX" # uname -s match # ------------------------- CONFIGURATION ends here --------------------------- @@ -322,7 +323,7 @@ do fi # bounce failures back and jump to next file - if (( _LOG_HEALTHY > 0 || _STC > 0 )) + if (( _LOG_HEALTHY > 0 && _STC > 0 )) then log_hc "$0" ${_STC} "${_MSG}" continue diff --git a/opt/hc/lib/platform/linux/check_linux_file_change.sh b/opt/hc/lib/platform/linux/check_linux_file_change.sh index 494a284..945199a 100755 --- a/opt/hc/lib/platform/linux/check_linux_file_change.sh +++ b/opt/hc/lib/platform/linux/check_linux_file_change.sh @@ -31,6 +31,7 @@ # @(#) 2019-03-09: added support for --log-healthy [Patrick Van der Veken] # @(#) 2019-03-16: replace 'which' [Patrick Van der Veken] # @(#) 2020-09-05: fix log_hc call for failed checksum + quote fix [Patrick Van der Veken] +# @(#) 2020-01-13: fix log_hc call (wrong logic) [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** @@ -40,7 +41,7 @@ function check_linux_file_change { # ------------------------- CONFIGURATION starts here ------------------------- typeset _CONFIG_FILE="${CONFIG_DIR}/$0.conf" -typeset _VERSION="2020-09-05" # YYYY-MM-DD +typeset _VERSION="2021-01-13" # YYYY-MM-DD typeset _SUPPORTED_PLATFORMS="Linux" # uname -s match # ------------------------- CONFIGURATION ends here --------------------------- @@ -323,7 +324,7 @@ do fi # bounce failures back and jump to next file - if (( _LOG_HEALTHY > 0 || _STC > 0 )) + if (( _LOG_HEALTHY > 0 && _STC > 0 )) then log_hc "$0" ${_STC} "${_MSG}" continue From c1082377654ba6af1b16f11165118bbc383b9780 Mon Sep 17 00:00:00 2001 From: Patrick Van der Veken Date: Wed, 13 Jan 2021 10:56:55 +0100 Subject: [PATCH 2/2] Comment fix --- opt/hc/lib/platform/aix/check_aix_file_change.sh | 2 +- opt/hc/lib/platform/hp-ux/check_hpux_file_change.sh | 2 +- opt/hc/lib/platform/linux/check_linux_file_change.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/opt/hc/lib/platform/aix/check_aix_file_change.sh b/opt/hc/lib/platform/aix/check_aix_file_change.sh index 5172c09..afc65dd 100755 --- a/opt/hc/lib/platform/aix/check_aix_file_change.sh +++ b/opt/hc/lib/platform/aix/check_aix_file_change.sh @@ -30,7 +30,7 @@ # @(#) 2019-03-09: added support for --log-healthy [Patrick Van der Veken] # @(#) 2019-03-16: replace 'which' [Patrick Van der Veken] # @(#) 2020-09-05: fix log_hc call for failed checksum + quote fix [Patrick Van der Veken] -# @(#) 2020-01-13: fix log_hc call (wrong logic) [Patrick Van der Veken] +# @(#) 2021-01-13: fix log_hc call (wrong logic) [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** diff --git a/opt/hc/lib/platform/hp-ux/check_hpux_file_change.sh b/opt/hc/lib/platform/hp-ux/check_hpux_file_change.sh index 3e4a61f..f051ec5 100755 --- a/opt/hc/lib/platform/hp-ux/check_hpux_file_change.sh +++ b/opt/hc/lib/platform/hp-ux/check_hpux_file_change.sh @@ -30,7 +30,7 @@ # @(#) 2019-03-09: added support for --log-healthy [Patrick Van der Veken] # @(#) 2019-03-16: replace 'which' [Patrick Van der Veken] # @(#) 2020-09-05: fix log_hc call for failed checksum + quote fix [Patrick Van der Veken] -# @(#) 2020-01-13: fix log_hc call (wrong logic) [Patrick Van der Veken] +# @(#) 2021-01-13: fix log_hc call (wrong logic) [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #****************************************************************************** diff --git a/opt/hc/lib/platform/linux/check_linux_file_change.sh b/opt/hc/lib/platform/linux/check_linux_file_change.sh index 945199a..e50e718 100755 --- a/opt/hc/lib/platform/linux/check_linux_file_change.sh +++ b/opt/hc/lib/platform/linux/check_linux_file_change.sh @@ -31,7 +31,7 @@ # @(#) 2019-03-09: added support for --log-healthy [Patrick Van der Veken] # @(#) 2019-03-16: replace 'which' [Patrick Van der Veken] # @(#) 2020-09-05: fix log_hc call for failed checksum + quote fix [Patrick Van der Veken] -# @(#) 2020-01-13: fix log_hc call (wrong logic) [Patrick Van der Veken] +# @(#) 2021-01-13: fix log_hc call (wrong logic) [Patrick Van der Veken] # ----------------------------------------------------------------------------- # DO NOT CHANGE THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING! #******************************************************************************