Add simulation mode without any modifications
This commit is contained in:
parent
d7dd9bd592
commit
03178436a9
|
@ -17,10 +17,14 @@ readonly NBARGS="${#}"
|
||||||
## Export DEBUG for sub-script
|
## Export DEBUG for sub-script
|
||||||
export DEBUG
|
export DEBUG
|
||||||
|
|
||||||
|
# If output message should be displayed
|
||||||
[ -z "${OUTPUT_MESSAGE}" ] && OUTPUT_MESSAGE=0
|
[ -z "${OUTPUT_MESSAGE}" ] && OUTPUT_MESSAGE=0
|
||||||
## Export OUTPUT_MESSAGE for sub-script
|
## Export OUTPUT_MESSAGE for sub-script
|
||||||
export OUTPUT_MESSAGE
|
export OUTPUT_MESSAGE
|
||||||
|
|
||||||
|
# If modifications should be applied
|
||||||
|
[ -z "${SIMULATE_MODE}" ] && SIMULATE_MODE=1
|
||||||
|
|
||||||
## Colors
|
## Colors
|
||||||
readonly PURPLE='\033[1;35m'
|
readonly PURPLE='\033[1;35m'
|
||||||
readonly RED='\033[0;31m'
|
readonly RED='\033[0;31m'
|
||||||
|
@ -156,11 +160,16 @@ prepare_host_for_upgrade() { # {{{
|
||||||
|
|
||||||
disable_host_queue_script="${PROGDIR}/disable.host.queue.sh"
|
disable_host_queue_script="${PROGDIR}/disable.host.queue.sh"
|
||||||
|
|
||||||
|
if [ "${SIMULATE_MODE}" -eq 0 ]; then
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
|
||||||
debug_message "prepare_host_for_upgrade − \
|
debug_message "prepare_host_for_upgrade − \
|
||||||
Disable SGE queue."
|
Disable SGE queue."
|
||||||
sh "${disable_host_queue_script}"
|
sh "${disable_host_queue_script}"
|
||||||
|
|
||||||
return "${?}"
|
return "${?}"
|
||||||
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
# }}}
|
# }}}
|
||||||
|
@ -218,9 +227,9 @@ if [ ! "${NBARGS}" -eq "0" ]; then
|
||||||
## Avoid to display any message on standard output
|
## Avoid to display any message on standard output
|
||||||
OUTPUT_MESSAGE=1
|
OUTPUT_MESSAGE=1
|
||||||
;;
|
;;
|
||||||
-s|--silent ) ## Silent mode
|
-s|--simulate ) ## Simulate mode
|
||||||
## Avoid to display any message on standard output
|
## Only display messages
|
||||||
OUTPUT_MESSAGE=1
|
SIMULATE_MODE=0
|
||||||
;;
|
;;
|
||||||
-- ) ## End of options list
|
-- ) ## End of options list
|
||||||
## End the while loop
|
## End the while loop
|
||||||
|
|
Loading…
Reference in New Issue