From c3cd76960cbafc9c74348fedfed01ba57361b83e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gardais=20J=C3=A9r=C3=A9my?= Date: Thu, 18 Jun 2020 16:39:14 +0200 Subject: [PATCH] Upgrade system --- cluster/apt.apply.update.sh | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/cluster/apt.apply.update.sh b/cluster/apt.apply.update.sh index 55b374b..2baf78d 100755 --- a/cluster/apt.apply.update.sh +++ b/cluster/apt.apply.update.sh @@ -66,7 +66,7 @@ debug_message() { # {{{ } # }}} -is_apt_upgrade_absent() { # {{{ +is_apt_upgrade_absent() { # {{{ ## Check if temp APT upgrade file is absent if [ ! -f "${APT_TMP_FILE}" ]; then @@ -100,7 +100,7 @@ NO APT upgrade available for this system." } # }}} -is_queue_enable() { # {{{ +is_queue_enable() { # {{{ local_sge_hostname="${1}" local_sge_queue_name="${2}" @@ -134,7 +134,7 @@ state is: ${RED}${local_sge_queue_state:=/dev/null}${COLOR_DEBUG}." } # }}} -is_job_running() { # {{{ +is_job_running() { # {{{ local_sge_hostname="${1}" ## List SGE informations about the host @@ -164,7 +164,7 @@ jobs running on ${local_sge_hostname} host: ${RED}${local_sge_slots_used}${COLOR } # }}} -is_proc_running() { # {{{ +is_proc_running() { # {{{ local_proc_pattern="${1}" @@ -185,6 +185,15 @@ procs running (with the pattern: ${RED}${local_proc_pattern}${COLOR_DEBUG}) on t return "${return_proc_running}" +} +# }}} +upgrade_system() { # {{{ + + debug_message "upgrade_system − \ +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 + } # }}} main() { # {{{ @@ -218,9 +227,12 @@ main() { # {{{ is_proc_running "${maco_proc_pattern}" \ && exit 0 + ## Try to upgrade the system + upgrade_system + } # }}} main -exit 0 +exit 255