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}" } # }}}