mirror of
https://github.com/eliasstepanik/ark-ac-server-tools.git
synced 2026-01-21 22:38:26 +00:00
Allow stop and restart commands to take a reason
This commit is contained in:
parent
053a938f56
commit
2b83abf65c
@ -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.
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user