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)

This commit is contained in:
Guillaume Raffy 2024-09-19 18:03:08 +02:00
parent 3f371e27c1
commit a6b4ccd81d
1 changed files with 8 additions and 8 deletions

View File

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