Rename get_maco_status to get_maco_update

This commit is contained in:
Jeremy Gardais 2021-01-13 11:21:23 +01:00
parent 9fa3f4b908
commit b6eb13621d
Signed by: jegardai
GPG Key ID: E759BAA22501AF32
1 changed files with 12 additions and 12 deletions

View File

@ -102,16 +102,16 @@ ${_file_empty} file is not empty."
}
# }}}
# Get Maco status {{{
get_maco_status() {
# Get Maco update state {{{
get_maco_update() {
maco_status_script_path="/opt/repos/ipr.scripts/cluster/maco.check.update.sh"
maco_status_script_options="--simulate"
maco_update_script_path="/opt/repos/ipr.scripts/cluster/maco.check.update.sh"
maco_update_script_options="--simulate"
## Run status_script and store result in PLUGIN_RESULT file
debug_message "get_maco_status \
Run \"${maco_status_script_path}\" script with \"${maco_status_script_options}\" options."
sh "${maco_status_script_path}" "${maco_status_script_options}" >> "${PLUGIN_RESULT}"
## Run update_script and store result in PLUGIN_RESULT file
debug_message "get_maco_update \
Run \"${maco_update_script_path}\" script with \"${maco_update_script_options}\" options."
sh "${maco_update_script_path}" "${maco_update_script_options}" >> "${PLUGIN_RESULT}"
}
# }}}
@ -119,7 +119,7 @@ Run \"${maco_status_script_path}\" script with \"${maco_status_script_options}\"
analyze_maco_status() {
debug_message "analyze_maco_status \
Try to detect Maco status with ${PLUGIN_RESULT} content."
Try to detect Maco update with ${PLUGIN_RESULT} content."
if grep -qE '^Local.* up to date.*' "${PLUGIN_RESULT}"
then
@ -131,7 +131,7 @@ Try to detect Maco status with ${PLUGIN_RESULT} content."
then
echo "1&red Maco needs urgent upgrade" >> "${PLUGIN_STATE}"
else
echo "4&clear Maco status is unknown" >> "${PLUGIN_STATE}"
echo "4&clear Maco update state is unknown" >> "${PLUGIN_STATE}"
fi
}
@ -167,9 +167,9 @@ main() { # {{{
regenerate_if_too_old "${PLUGIN_STATE}"
# If previous result is empty
## Re-check Maco status
## Re-check Maco update
is_file_empty "${PLUGIN_RESULT}" \
&& get_maco_status
&& get_maco_update
# If previous state is empty
## analyze Maco's result