diff --git a/cluster/sge.enable.host.queue.sh b/cluster/sge.enable.host.queue.sh index e686b9d..83b6198 100755 --- a/cluster/sge.enable.host.queue.sh +++ b/cluster/sge.enable.host.queue.sh @@ -47,8 +47,9 @@ OPTIONS : Enable debug messages. -f,--force - Force to (re)enable a queue even if it was - previously manually disabled (by a user). + Try to (re)enable a queue even if it was previously + manually disabled (by a user) and avoid all checks + (pending upgrades, running processes, files,…). --help Print this help message. @@ -97,10 +98,10 @@ define_vars() { # {{{ ${sge_hostname} is the current host." ## Enable to verify if pending upgrades are present CHECK_UPGRADE="0" - ## Enable to verify if upgrades are running - CHECK_PROCESS="0" ## Enable to watch if some files are present CHECK_FILE="0" + ## Enable to verify if upgrades are running + CHECK_PROCESS="0" else ## In case of a remote host debug_message "define_vars − \ ${sge_hostname} is not the current host." @@ -112,10 +113,10 @@ ${sge_hostname} is not the current host." if [ -n "${FORCE_MODE}" ] && [ "${FORCE_MODE}" -eq "0" ]; then ## Disable upgrade checking (remote host, asked behaviour,…) CHECK_UPGRADE="1" - ## Disable process checking (remote host, asked behaviour,…) - CHECK_PROCESS="1" ## Disable files monitoring CHECK_FILE="1" + ## Disable process checking (remote host, asked behaviour,…) + CHECK_PROCESS="1" else ## Ensure to define a value FORCE_MODE="1" @@ -403,6 +404,19 @@ main() { # {{{ && exit 0 fi + ## If we need to watch files + if [ "${CHECK_FILE}" -eq "0" ]; then + ## If nologin file exist (error on upgrade,…) + ### Exit + is_file_present "${file_nologin_path}" \ + && exit 0 + + ## If all SGE queue(s) were manually disabled (not any flag file) + ### Exit + is_file_absent "${sge_queue_flag_pattern}" \ + && exit 0 + fi + ## If we need to watch for processes if [ "${CHECK_PROCESS}" -eq "0" ]; then ## If anything related to APT is currently running @@ -416,19 +430,6 @@ main() { # {{{ && exit 0 fi - ## If we need to watch files - if [ "${CHECK_FILE}" -eq "0" ]; then - ## If nologin file exist - ### Exit - is_file_present "${file_nologin_path}" \ - && exit 0 - - ## If all SGE queue(s) were manually disabled (not any flag file) - ### Exit - is_file_absent "${sge_queue_flag_pattern}" \ - && exit 0 - fi - ## Simple debug message with color to valid current variables debug_message "main − Try to manage \ SGE queue(s): ${RED}${sge_queues_name_print:=/dev/null}${COLOR_DEBUG}\