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