msctl: use a lock file for Overviewer

This commit is contained in:
Jason M. Wood 2016-08-05 19:27:16 -06:00
parent 64f796149b
commit 0cd051a3dd

10
msctl
View File

@ -2480,7 +2480,15 @@ case "$1" in
printf "Running Minecraft Overviewer mapping:"
for WORLD in $WORLDS; do
printf " $WORLD"
overviewer "$WORLD"
# Create a lock file so that we don't create duplicate processes.
if $(createLockFile $WORLD "overviewer"); then
overviewer "$WORLD"
# Remove the lock file.
removeLockFile $WORLD "overviewer"
else
printf "\nError lock file for world $WORLD could not be created."
printf " Is the world already running Overviewer?\n"
fi
done
printf ".\n"
;;