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