diff --git a/cluster/apt.apply.update.sh b/cluster/apt.apply.update.sh index 5fe0a43..3fceb08 100755 --- a/cluster/apt.apply.update.sh +++ b/cluster/apt.apply.update.sh @@ -68,6 +68,23 @@ debug_message() { # {{{ return 0 } # }}} +is_sge_host() { # {{{ + + ## Check if SGE commands (qhost) are available + if [ "$(command -v qhost)" ]; then + return_is_sge_host="0" + debug_message "is_sge_host − \ +SGE seems present on this host." + else + return_is_sge_host="1" + debug_message "is_sge_host − \ +SGE is not present on this host." + fi + + return "${return_is_sge_host}" + +} +# }}} is_apt_upgrade_absent() { # {{{ ## Check if temp APT upgrade file is absent @@ -211,7 +228,7 @@ procs running (with the pattern: ${RED}${local_proc_pattern}${COLOR_DEBUG}) on t } # }}} -prepare_host() { # {{{ +prepare_host() { # {{{ debug_message "prepare_host − \ Forbid SSH logins,…". @@ -247,6 +264,11 @@ main() { # {{{ manage_args "${ARGS}" + ## If SGE is not yet available on this host + ### Exit + is_sge_host \ + || exit 0 + sge_hostname="$(hostname -f)" sge_queues_name="$(qhost -h "${sge_hostname:=/dev/null}" -q -xml \ | grep "queue name" \ diff --git a/cluster/apt.check.update.sh b/cluster/apt.check.update.sh index 415b0e2..fe57509 100755 --- a/cluster/apt.check.update.sh +++ b/cluster/apt.check.update.sh @@ -84,6 +84,23 @@ define_vars() { # {{{ | grep --max-count=1 -- "'slots_used'" \ | sed 's;.*\(.*\);\1;') +} +# }}} +is_sge_host() { # {{{ + + ## Check if SGE commands (qhost) are available + if [ "$(command -v qhost)" ]; then + return_is_sge_host="0" + debug_message "is_sge_host − \ +SGE seems present on this host." + else + return_is_sge_host="1" + debug_message "is_sge_host − \ +SGE is not present on this host." + fi + + return "${return_is_sge_host}" + } # }}} is_apt_upgrade_absent() { # {{{ @@ -156,6 +173,12 @@ main() { # {{{ ## Define all vars define_vars + ## If SGE is not yet available on this host {{{ + ### Exit + is_sge_host \ + || exit 0 + ## }}} + ## If NO APT package upgrade is available {{{ ### Ensure to remove any temp file related to APT upgrades ### AND Exit diff --git a/cluster/maco.apply.update.sh b/cluster/maco.apply.update.sh index 5bebb74..93b9d61 100755 --- a/cluster/maco.apply.update.sh +++ b/cluster/maco.apply.update.sh @@ -73,6 +73,23 @@ debug_message() { # {{{ return 0 } # }}} +is_sge_host() { # {{{ + + ## Check if SGE commands (qhost) are available + if [ "$(command -v qhost)" ]; then + return_is_sge_host="0" + debug_message "is_sge_host − \ +SGE seems present on this host." + else + return_is_sge_host="1" + debug_message "is_sge_host − \ +SGE is not present on this host." + fi + + return "${return_is_sge_host}" + +} +# }}} is_apt_upgrade_present() { # {{{ ## Check if temp APT upgrade file exists @@ -244,6 +261,11 @@ main() { # {{{ manage_args "${ARGS}" + ## If SGE is not yet available on this host + ### Exit + is_sge_host \ + || exit 0 + sge_hostname="$(hostname -f)" sge_queues_name="$(qhost -h "${sge_hostname:=/dev/null}" -q -xml \ | grep "queue name" \ diff --git a/cluster/sge.enable.host.queue.sh b/cluster/sge.enable.host.queue.sh index f1f4f09..5f4efd2 100755 --- a/cluster/sge.enable.host.queue.sh +++ b/cluster/sge.enable.host.queue.sh @@ -147,6 +147,23 @@ ${sge_hostname} is not the current host." sge_queue_flag_pattern="${cluster_dir}/.sge.*.disable" } # }}} +is_sge_host() { # {{{ + + ## Check if SGE commands (qhost) are available + if [ "$(command -v qhost)" ]; then + return_is_sge_host="0" + debug_message "is_sge_host − \ +SGE seems present on this host." + else + return_is_sge_host="1" + debug_message "is_sge_host − \ +SGE is not present on this host." + fi + + return "${return_is_sge_host}" + +} +# }}} is_current_host() { # {{{ local_current_host="${1}" @@ -427,6 +444,11 @@ main() { # {{{ ## Define all vars according the selected options define_vars + ## If SGE is not yet available on this host + ### Exit + is_sge_host \ + || exit 0 + ## If we need to watch for upgrades if [ "${CHECK_UPGRADE}" -eq "0" ]; then ## If APT package upgrade is available