mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-09-18 11:57:57 +00:00
Adding Minecraft -e options for the game mode and level seed
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
|
|
||||||
case $VERSION in
|
case $VERSION in
|
||||||
LATEST)
|
LATEST)
|
||||||
@@ -24,9 +24,34 @@ fi
|
|||||||
if [ -n "$MOTD" ]; then
|
if [ -n "$MOTD" ]; then
|
||||||
sed -i "/motd\s*=/ c motd=$MOTD" /data/server.properties
|
sed -i "/motd\s*=/ c motd=$MOTD" /data/server.properties
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$LEVEL" ]; then
|
if [ -n "$LEVEL" ]; then
|
||||||
sed -i "/level-name\s*=/ c level-name=$LEVEL" /data/server.properties
|
sed -i "/level-name\s*=/ c level-name=$LEVEL" /data/server.properties
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -n "$SEED" ]; then
|
||||||
|
sed -i "/level-seed\s*=/ c level-seed=$SEED" /data/server.properties
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "$MODE" ]; then
|
||||||
|
case ${MODE,,?} in
|
||||||
|
0|1|2|3)
|
||||||
|
;;
|
||||||
|
s*)
|
||||||
|
MODE=0
|
||||||
|
;;
|
||||||
|
c*)
|
||||||
|
MODE=1
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "ERROR: Invalid game mode: $MODE"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
sed -i "/gamemode\s*=/ c gamemode=$MODE" /data/server.properties
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -n "$OPS" ]; then
|
if [ -n "$OPS" ]; then
|
||||||
echo $OPS | awk -v RS=, '{print}' >> ops.txt
|
echo $OPS | awk -v RS=, '{print}' >> ops.txt
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user