Launch maco upgrade

This commit is contained in:
Jeremy Gardais 2020-06-22 11:00:24 +02:00
parent 2257ab7742
commit 17e8e0027d
Signed by: jegardai
GPG Key ID: E759BAA22501AF32
1 changed files with 17 additions and 2 deletions

View File

@ -4,8 +4,9 @@
# 1. All SGE queues are disable # 1. All SGE queues are disable
# 2. No SGE jobs are running # 2. No SGE jobs are running
# 3. No process related to Maco are already running # 3. No process related to Maco are already running
# 4. No process related to APT are currently running
# This script can be call by a cronjob (eg. hourly) # This script can be called by a cronjob (eg. hourly)
# Vars {{{ # Vars {{{
readonly PROGNAME=$(basename "${0}") readonly PROGNAME=$(basename "${0}")
@ -219,6 +220,15 @@ procs running (with the pattern: ${RED}${local_proc_pattern}${COLOR_DEBUG}) on t
return "${return_proc_running}" return "${return_proc_running}"
}
# }}}
upgrade_maco() { # {{{
debug_message "upgrade_maco \
Try to apply Maco upgrade".
/opt/maco/bin/maco.autoupdate.sh
} }
# }}} # }}}
main() { # {{{ main() { # {{{
@ -234,7 +244,7 @@ main() { # {{{
apt_proc_pattern="(aptitude.*full-upgrade|/usr/bin/dpkg.*--configure|dpkg-deb|/bin/sh /usr/lib/needrestart/dpkg-status)" apt_proc_pattern="(aptitude.*full-upgrade|/usr/bin/dpkg.*--configure|dpkg-deb|/bin/sh /usr/lib/needrestart/dpkg-status)"
## If APT package upgrade is available ## If APT package upgrade is available
### Exit (wait for APT upgrade to finish first) ### Exit (wait for APT upgrade to be applied first)
is_apt_upgrade_present \ is_apt_upgrade_present \
&& exit 0 && exit 0
@ -263,6 +273,11 @@ main() { # {{{
is_proc_running "${apt_proc_pattern}" \ is_proc_running "${apt_proc_pattern}" \
&& exit 0 && exit 0
## Upgrade Maco
### If error: Exit 50
upgrade_maco \
|| exit 50
} }
# }}} # }}}