From 3b29544775b0faa2253a0972e1073c4abcaa30ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gardais=20J=C3=A9r=C3=A9my?= Date: Thu, 14 Jan 2021 11:59:44 +0100 Subject: [PATCH] Empty TEMP_MACO_UPDATE file if too old --- xymon/plugins/client/ext/maco.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/xymon/plugins/client/ext/maco.sh b/xymon/plugins/client/ext/maco.sh index d94ae13..1848142 100755 --- a/xymon/plugins/client/ext/maco.sh +++ b/xymon/plugins/client/ext/maco.sh @@ -217,7 +217,7 @@ No Maco urgent update is planned." } # }}} -# Verify the status of last Maco update +# Verify the status of last Maco update {{{ check_last_update_status() { ## Check if Maco status file is present and readable @@ -281,13 +281,18 @@ main() { # {{{ # Create or empty previous file only if too old regenerate_if_too_old "${PLUGIN_RESULT}" regenerate_if_too_old "${PLUGIN_STATE}" + regenerate_if_too_old "${TEMP_MACO_UPDATE}" + + ## If TEMP_MACO_UPDATE file is empty + if is_file_empty "${TEMP_MACO_UPDATE}"; then + ## (re)check Maco update + get_maco_update + fi ## If any previous file is empty if is_file_empty "${PLUGIN_RESULT}" || is_file_empty "${PLUGIN_STATE}"; then ## Add HTML header for this part add_header "Compare version" >> "${PLUGIN_RESULT}" - ## (re)check Maco update - get_maco_update ## Analyze Maco update result (add color,…) analyze_maco_update