From d8c34f6fcc790010f2cfd4a97d9f8168ec82ec61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gardais=20J=C3=A9r=C3=A9my?= Date: Wed, 6 Jan 2021 12:12:55 +0100 Subject: [PATCH] Clean temp files before run maco_upgrade --- cluster/maco.apply.update.sh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/cluster/maco.apply.update.sh b/cluster/maco.apply.update.sh index 06ea4cf..5bebb74 100755 --- a/cluster/maco.apply.update.sh +++ b/cluster/maco.apply.update.sh @@ -232,6 +232,14 @@ Try to apply Maco upgrade". } # }}} +clean_host() { # {{{ + + debug_message "clean_host − \ +Try to clean temp files,…" + + rm -f -- "${MACO_TMP_FILE}" "${MACO_TMP_URGENT_FILE}" +} +# }}} main() { # {{{ manage_args "${ARGS}" @@ -278,10 +286,12 @@ main() { # {{{ ### First, ensure maco.service is enable for next reboot systemctl --quiet enable maco.service > /dev/null 2>&1 - ## Then try to upgrade Maco + ## Then, Maco is ready for upgrade + ### First clean temp files on the host + ### And try to upgrade Maco ### If success: exit 0 (leave reboot to maco/atd) - ### Temp files will be automatically cleaned at next startup - upgrade_maco \ + clean_host \ + && upgrade_maco \ && exit 0 }