Exit if the queue is already disable

This commit is contained in:
Jeremy Gardais 2020-06-03 17:51:04 +02:00
parent ea3ecf26cf
commit 1e2bbcea40
Signed by: jegardai
GPG Key ID: E759BAA22501AF32
1 changed files with 6 additions and 6 deletions

View File

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