Allow stop and restart commands to take a reason

This commit is contained in:
Ben Peddell 2016-05-16 17:39:49 +10:00
parent 053a938f56
commit 2b83abf65c

View File

@ -816,10 +816,24 @@ doStartAll(){
# #
doStop() { doStop() {
if isTheServerRunning; then if isTheServerRunning; then
if [[ " $* " =~ " --warn " ]]; then local stopreason="$1"
doWarn "$1" local dowarn=
local warnreason=
local dosave=
shift
for arg in "$@"; do
case "$arg" in
--warn) dowarn=1; ;;
--warnreason=*) warnreason="${arg#*=}"; ;;
--saveworld) dosave=1; ;;
esac
done
if [[ -n "$dowarn" ]]; then
doWarn "$1" "$warnreason"
fi fi
if [[ " $* " =~ " --saveworld " ]]; then if [[ -n "$dosave" ]]; then
doSaveWorld doSaveWorld
fi fi
tput sc tput sc
@ -1237,7 +1251,7 @@ doUpdate() {
doSaveWorld doSaveWorld
fi fi
doStop doStop update
# If user wants to back-up, we do it here. # If user wants to back-up, we do it here.