Let Maco reboot the host with atd

This commit is contained in:
Jeremy Gardais 2020-12-22 15:42:16 +01:00
parent 036975b8fc
commit 1595b625cd
Signed by: jegardai
GPG Key ID: E759BAA22501AF32
1 changed files with 3 additions and 16 deletions

View File

@ -10,7 +10,6 @@
# Vars {{{
readonly PROGNAME=$(basename "${0}")
readonly PROGDIR=$(readlink -m $(dirname "${0}"))
readonly ARGS="${*}"
readonly NBARGS="${#}"
[ -z "${DEBUG}" ] && readonly DEBUG=1
@ -230,15 +229,6 @@ 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() { # {{{
@ -288,13 +278,10 @@ main() { # {{{
systemctl --quiet enable maco.service > /dev/null 2>&1
## Then try to upgrade Maco
### If error: Exit 50
### If success: Clean host (temp files,…)
### then reboot the system
### If success: exit 0 (leave reboot to maco/atd)
### Temp files will be automatically cleaned at next startup
upgrade_maco \
|| exit 50 \
&& clean_host \
&& systemctl reboot
&& exit 0
}
# }}}