From 872bb98950755c97cbc6d9719cd3c9ce09fda38d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gardais=20J=C3=A9r=C3=A9my?= Date: Mon, 22 Jun 2020 11:08:02 +0200 Subject: [PATCH] Clean temp files after successful upgrade --- cluster/maco.apply.update.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/cluster/maco.apply.update.sh b/cluster/maco.apply.update.sh index 22c6065..63c2b92 100755 --- a/cluster/maco.apply.update.sh +++ b/cluster/maco.apply.update.sh @@ -229,6 +229,15 @@ Try to apply Maco upgrade". /opt/maco/bin/maco.autoupdate.sh +} +# }}} +clean_host() { # {{{ + + debug_message "clean_host − \ +Try to clean temp files,…". + + rm -f -- "${MACO_TMP_FILE}" "${MACO_TMP_URGENT_FILE}" + } # }}} main() { # {{{ @@ -273,10 +282,12 @@ main() { # {{{ is_proc_running "${apt_proc_pattern}" \ && exit 0 - ## Upgrade Maco + ## Try to upgrade Maco ### If error: Exit 50 + ### If success: Clean host (temp files,…) upgrade_maco \ - || exit 50 + || exit 50 \ + && clean_host } # }}}