From a6b4ccd81d087ea334635cbf3b7e2d4a6c6a2a16 Mon Sep 17 00:00:00 2001 From: Guillaume Raffy Date: Thu, 19 Sep 2024 18:03:08 +0200 Subject: [PATCH] improved documentation of retry mode which wasn't clear, while trying to work out if croconaus is supposed to restart maco automatically or not (well it is) --- cluster/maco.check.update.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/cluster/maco.check.update.sh b/cluster/maco.check.update.sh index 147fac0..198b1c9 100755 --- a/cluster/maco.check.update.sh +++ b/cluster/maco.check.update.sh @@ -66,7 +66,7 @@ OPTIONS : Enable debug messages. -f,--fail - Check update only if the last Maco update failed. + enables retry mode: enable this mode to trigger a maco update only if the last Maco update has failed (in this mode a new maco version is not checked). -h,--help Print this help message. @@ -346,10 +346,10 @@ main() { # {{{ || exit 0 ## }}} - ## If MACO_FAILED_MODE wasn't defined (argument, environment variable,…) {{{ - if [ -z "${MACO_FAILED_MODE}" ]; then + ## If MACO_RETRY_MODE wasn't defined (argument, environment variable,…) {{{ + if [ -z "${MACO_RETRY_MODE}" ]; then ### Set False by default - MACO_FAILED_MODE="1" + MACO_RETRY_MODE="1" fi ## }}} @@ -384,9 +384,9 @@ Get Maco's versions from webserver." is_var_empty "${CURRENT_MACO_VERSION}" "${LATEST_MACO_VERSION}" "${URGENT_MACO_VERSION}" "${CURRENT_TIMESTAMP}" "${LATEST_TIMESTAMP}" "${URGENT_TIMESTAMP}" \ && exit 1 - ## If MACO_FAILED_MODE is set {{{ + ## If MACO_RETRY_MODE is set {{{ ### Exit if Maco last-update-succeeded - if [ "${MACO_FAILED_MODE}" -eq "0" ]; then + if [ "${MACO_RETRY_MODE}" -eq "0" ]; then ### If Macostatus=last-update-succeeded ### Exit is_maco_status_ok \ @@ -432,8 +432,8 @@ if [ ! "${NBARGS}" -eq "0" ]; then while printf -- '%s' "${1}" | grep -q -E -- "^-+"; do case "${1}" in - -f|--fail ) ## Failed mode - MACO_FAILED_MODE="0" + -f|--fail ) ## retry mode + MACO_RETRY_MODE="0" ;; -h|--help ) ## help usage