mirror of
https://github.com/MinecraftServerControl/mscs.git
synced 2024-11-15 06:48:16 -07:00
Tweak the stop functions to not mess up the mirrors
Otherwise it synchronizes the mirror image during shutdown ...
This commit is contained in:
parent
394801882f
commit
fc7a24f655
14
msctl
14
msctl
@ -1107,11 +1107,14 @@ start() {
|
|||||||
# @param 1 The world server to stop.
|
# @param 1 The world server to stop.
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
stop() {
|
stop() {
|
||||||
local WORLD NUM
|
# Tell the server to stop.
|
||||||
sendCommand $1 "stop"
|
sendCommand $1 "stop"
|
||||||
sendCommand $1 "end"
|
sendCommand $1 "end"
|
||||||
# Synchronize the mirror image of the world prior to closing, if
|
# Wait for the server to shut down.
|
||||||
# required.
|
while serverRunning $1; do
|
||||||
|
sleep 1
|
||||||
|
done;
|
||||||
|
# Synchronize the mirror image of the world prior to closing, if required.
|
||||||
if [ $ENABLE_MIRROR -eq 1 ] && [ -L "$WORLDS_LOCATION/$1/$1" ] && [ -d "$MIRROR_PATH/$1" ]; then
|
if [ $ENABLE_MIRROR -eq 1 ] && [ -L "$WORLDS_LOCATION/$1/$1" ] && [ -d "$MIRROR_PATH/$1" ]; then
|
||||||
syncMirrorImage $1
|
syncMirrorImage $1
|
||||||
# Remove the symlink to the world-file mirror image.
|
# Remove the symlink to the world-file mirror image.
|
||||||
@ -1132,10 +1135,13 @@ stop() {
|
|||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
forceStop() {
|
forceStop() {
|
||||||
# Try to stop the server cleanly first.
|
# Try to stop the server cleanly first.
|
||||||
stop "$1"
|
sendCommand $1 "stop"
|
||||||
|
sendCommand $1 "end"
|
||||||
sleep 10
|
sleep 10
|
||||||
# Kill the process id of the world server.
|
# Kill the process id of the world server.
|
||||||
kill -9 $(getJavaPID "$1") > /dev/null 2>&1
|
kill -9 $(getJavaPID "$1") > /dev/null 2>&1
|
||||||
|
# Properly clean up.
|
||||||
|
stop $1
|
||||||
}
|
}
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user