Check maco_update if any file is empty

This commit is contained in:
Jeremy Gardais 2021-01-13 12:16:37 +01:00
parent 19c1756bef
commit cc83325ed9
Signed by: jegardai
GPG Key ID: E759BAA22501AF32
1 changed files with 7 additions and 9 deletions

View File

@ -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