Clean temp data if upgrade succeed
This commit is contained in:
parent
d133af4fed
commit
6af24258ad
|
@ -222,6 +222,16 @@ Try to apply APT upgrades".
|
|||
|
||||
DEBIAN_FRONTEND=noninteractive aptitude -y -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confold full-upgrade >> "${APT_TMP_FILE}" 2>&1
|
||||
|
||||
}
|
||||
# }}}
|
||||
clean_host() { # {{{
|
||||
|
||||
debug_message "clean_host − \
|
||||
Try to clean temp files, downloaded packages,…".
|
||||
|
||||
aptitude clean >> "${APT_TMP_FILE}" 2>&1 \
|
||||
&& rm -f -- "${APT_TMP_FILE}"
|
||||
|
||||
}
|
||||
# }}}
|
||||
main() { # {{{
|
||||
|
@ -256,9 +266,11 @@ main() { # {{{
|
|||
&& exit 0
|
||||
|
||||
## Try to upgrade the system
|
||||
### Exit 50 if any error in returned value
|
||||
### If error: Exit 50
|
||||
### If success: Clean host (temp files, download,…)
|
||||
upgrade_system \
|
||||
|| exit 50
|
||||
|| exit 50 \
|
||||
&& clean_host
|
||||
|
||||
## If Maco upgrade is present
|
||||
### Exit (and leave Maco manage required reboot if present)
|
||||
|
|
Loading…
Reference in New Issue