From 17e8e0027d85d594dc352cdaf4391bb5a00de8a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gardais=20J=C3=A9r=C3=A9my?= Date: Mon, 22 Jun 2020 11:00:24 +0200 Subject: [PATCH] Launch maco upgrade --- cluster/maco.apply.update.sh | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/cluster/maco.apply.update.sh b/cluster/maco.apply.update.sh index 1badd57..22c6065 100755 --- a/cluster/maco.apply.update.sh +++ b/cluster/maco.apply.update.sh @@ -4,8 +4,9 @@ # 1. All SGE queues are disable # 2. No SGE jobs are 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 {{{ 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}" +} +# }}} +upgrade_maco() { # {{{ + + debug_message "upgrade_maco − \ +Try to apply Maco upgrade". + + /opt/maco/bin/maco.autoupdate.sh + } # }}} 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)" ## 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 \ && exit 0 @@ -263,6 +273,11 @@ main() { # {{{ is_proc_running "${apt_proc_pattern}" \ && exit 0 + ## Upgrade Maco + ### If error: Exit 50 + upgrade_maco \ + || exit 50 + } # }}}