From cc83325ed9f9b235eb8620b2f25a317dc2a08eec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gardais=20J=C3=A9r=C3=A9my?= Date: Wed, 13 Jan 2021 12:16:37 +0100 Subject: [PATCH] Check maco_update if any file is empty --- xymon/plugins/client/ext/maco.sh | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/xymon/plugins/client/ext/maco.sh b/xymon/plugins/client/ext/maco.sh index 186f560..7c09cbf 100755 --- a/xymon/plugins/client/ext/maco.sh +++ b/xymon/plugins/client/ext/maco.sh @@ -181,15 +181,13 @@ main() { # {{{ regenerate_if_too_old "${PLUGIN_RESULT}" regenerate_if_too_old "${PLUGIN_STATE}" - # If previous result is empty - ## Re-check Maco update - is_file_empty "${PLUGIN_RESULT}" \ - && get_maco_update - - # If previous state is empty - ## analyze Maco's result - is_file_empty "${PLUGIN_STATE}" \ - && analyze_maco_update + ## If any previous file is empty + if is_file_empty "${PLUGIN_RESULT}" || is_file_empty "${PLUGIN_STATE}"; then + ## (re)check Maco update + get_maco_update + ## Analyze Maco update result (add color,…) + analyze_maco_update + fi # Send data to Xymon server ## and exit