From 1e2bbcea4097197fe0d767902ecd7047c94ef549 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gardais=20J=C3=A9r=C3=A9my?= Date: Wed, 3 Jun 2020 17:51:04 +0200 Subject: [PATCH] Exit if the queue is already disable --- cluster/disable.host.queue.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cluster/disable.host.queue.sh b/cluster/disable.host.queue.sh index 474d822..3d85d74 100755 --- a/cluster/disable.host.queue.sh +++ b/cluster/disable.host.queue.sh @@ -102,7 +102,7 @@ is_queue_disable() { # {{{ ;; * ) ## Unexpected result printf '%b\n' "${RED}Not able to determine the state of ${local_sge_queue_name:=/dev/null}@${local_sge_hostname:=/dev/null} queue.${RESET}" - exit 2 + exit 3 ;; esac @@ -145,15 +145,15 @@ main() { # {{{ SGE queue: ${RED}${sge_queue_name:=/dev/null}${COLOR_DEBUG} \ for host: ${RED}${sge_hostname:=/dev/null}${COLOR_DEBUG}." + ## If the queue is already disable + ### Exit + is_queue_disable "${sge_hostname}" "${sge_queue_name}" \ + && exit 0 + ## If the queue is enable ### Try to disable it is_queue_enable "${sge_hostname}" "${sge_queue_name}" \ && disable_sge_queue "${sge_hostname}" "${sge_queue_name}" - #&& printf '%b\n' "function disable_queue." - - ## If the queue is disable - ### Nothing to do - is_queue_disable "${sge_hostname}" "${sge_queue_name}" } # }}}