aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar TheMightyV <themightyv@protonmail.com> 2022-01-02 20:15:48 +0100
committerGravatar TheMightyV <themightyv@protonmail.com> 2022-01-02 20:16:11 +0100
commit023a18b1d150fc9c09bf6ac135663f7ddce3b757 (patch)
tree6c56d59af5e1b266e1610d448278500f35a37490
parentde4fc74d50d536f524aa4c65e270123bfe8ef893 (diff)
downloadminecraft-server-tools-023a18b1d150fc9c09bf6ac135663f7ddce3b757.tar.gz
fallback world name to server.properties
-rw-r--r--serverconf.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/serverconf.sh b/serverconf.sh
index a73a65d..3748541 100644
--- a/serverconf.sh
+++ b/serverconf.sh
@@ -12,6 +12,10 @@ TMUX_WINDOW="minecraft"
TMUX_SOCKET="mc_tmux_socket"
WORLD_NAME="lfja"
+if [ -f "server.properties" ]; then
+ WORLD_NAME=$(grep level-name server.properties | cut -d= -f2)
+ echo "Getting world name from server.properties: $WORLD_NAME"
+fi
BACKUP_NAME="${WORLD_NAME}_backup"
LOGFILE="logs/latest.log"