Add debug_message function
This commit is contained in:
parent
d317376171
commit
4cfedce127
|
@ -50,6 +50,15 @@ EXAMPLES :
|
||||||
${PROGNAME} marvin.domain.tld
|
${PROGNAME} marvin.domain.tld
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
}
|
||||||
|
# }}}
|
||||||
|
debug_message() { # {{{
|
||||||
|
|
||||||
|
local_message="${1}"
|
||||||
|
|
||||||
|
## Print message if DEBUG is enable (=0)
|
||||||
|
[ "${DEBUG}" -eq "0" ] && printf '\e[1;35m%-6b\e[m\n' "DEBUG − ${PROGNAME} : ${local_message}"
|
||||||
|
|
||||||
}
|
}
|
||||||
# }}}
|
# }}}
|
||||||
is_queue_enable() { # {{{
|
is_queue_enable() { # {{{
|
||||||
|
@ -76,7 +85,7 @@ is_queue_enable() { # {{{
|
||||||
esac
|
esac
|
||||||
|
|
||||||
## Simple debug message to valid current variables
|
## Simple debug message to valid current variables
|
||||||
[ "${DEBUG}" -eq "0" ] && printf '\e[1;35m%-6b\e[m\n' "DEBUG − ${PROGNAME} : is_queue_enable − \
|
debug_message "is_queue_enable − \
|
||||||
SGE queue: ${RED}${local_sge_queue_name:=/dev/null}${COLOR_DEBUG} \
|
SGE queue: ${RED}${local_sge_queue_name:=/dev/null}${COLOR_DEBUG} \
|
||||||
state is: ${RED}${local_sge_queue_state:=/dev/null}${COLOR_DEBUG}."
|
state is: ${RED}${local_sge_queue_state:=/dev/null}${COLOR_DEBUG}."
|
||||||
|
|
||||||
|
@ -108,7 +117,7 @@ is_queue_disable() { # {{{
|
||||||
esac
|
esac
|
||||||
|
|
||||||
## Simple debug message to valid current variables
|
## Simple debug message to valid current variables
|
||||||
[ "${DEBUG}" -eq "0" ] && printf '\e[1;35m%-6b\e[m\n' "DEBUG − ${PROGNAME} : is_queue_disable − \
|
debug_message "is_queue_disable − \
|
||||||
SGE queue: ${RED}${local_sge_queue_name:=/dev/null}${COLOR_DEBUG} \
|
SGE queue: ${RED}${local_sge_queue_name:=/dev/null}${COLOR_DEBUG} \
|
||||||
state is: ${RED}${local_sge_queue_state:=/dev/null}${COLOR_DEBUG}."
|
state is: ${RED}${local_sge_queue_state:=/dev/null}${COLOR_DEBUG}."
|
||||||
|
|
||||||
|
@ -122,7 +131,7 @@ disable_sge_queue() { # {{{
|
||||||
local_sge_queue_name="${2}"
|
local_sge_queue_name="${2}"
|
||||||
|
|
||||||
## Simple debug message to valid current variables
|
## Simple debug message to valid current variables
|
||||||
[ "${DEBUG}" -eq "0" ] && printf '\e[1;35m%-6b\e[m\n' "DEBUG − ${PROGNAME} : disable_sge_queue − \
|
debug_message "disable_sge_queue − \
|
||||||
Try to disable SGE queue: ${RED}${local_sge_queue_name:=/dev/null}@${local_sge_hostname:=/dev/null}${COLOR_DEBUG}."
|
Try to disable SGE queue: ${RED}${local_sge_queue_name:=/dev/null}@${local_sge_hostname:=/dev/null}${COLOR_DEBUG}."
|
||||||
|
|
||||||
## SGE command to disable the queue
|
## SGE command to disable the queue
|
||||||
|
@ -142,7 +151,7 @@ main() { # {{{
|
||||||
| cut -d"'" -f2 )"
|
| cut -d"'" -f2 )"
|
||||||
|
|
||||||
## Simple debug message with color to valid current variables
|
## Simple debug message with color to valid current variables
|
||||||
[ "${DEBUG}" -eq "0" ] && printf '\e[1;35m%-6b\e[m\n' "DEBUG − ${PROGNAME} : main − Try to manage \
|
debug_message "main − Try to manage \
|
||||||
SGE queue: ${RED}${sge_queue_name:=/dev/null}${COLOR_DEBUG} \
|
SGE queue: ${RED}${sge_queue_name:=/dev/null}${COLOR_DEBUG} \
|
||||||
for host: ${RED}${sge_hostname:=/dev/null}${COLOR_DEBUG}."
|
for host: ${RED}${sge_hostname:=/dev/null}${COLOR_DEBUG}."
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue