Clean temp files before run maco_upgrade

This commit is contained in:
Jeremy Gardais 2021-01-06 12:12:55 +01:00
parent 5222bdf3e5
commit d8c34f6fcc
Signed by: jegardai
GPG Key ID: E759BAA22501AF32
1 changed files with 13 additions and 3 deletions

View File

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