mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2024-06-07 19:40:43 +00:00
Simplify start-minecraft.sh
This commit is contained in:
parent
ddbc7e9618
commit
79438e14de
@ -15,19 +15,24 @@ if [ ! -e /data/eula.txt ]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
case $VERSION in
|
||||||
|
LATEST)
|
||||||
|
VANILLA_VERSION=`wget -O - https://s3.amazonaws.com/Minecraft.Download/versions/versions.json | jsawk -n 'out(this.latest.release)'`
|
||||||
|
FORGE_VERSION=`wget -O - http://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json \
|
||||||
|
| jsawk -n 'out(this.promos.recommended)'`
|
||||||
|
;;
|
||||||
|
SNAPSHOT)
|
||||||
|
VANILLA_VERSION=`wget -O - https://s3.amazonaws.com/Minecraft.Download/versions/versions.json | jsawk -n 'out(this.latest.snapshot)'`
|
||||||
|
FORGE_VERSION=`wget -O - http://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json \
|
||||||
|
| jsawk -n 'out(this.promos.latest)'`
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
cd /data
|
cd /data
|
||||||
|
|
||||||
case $TYPE in
|
case $TYPE in
|
||||||
VANILLA)
|
VANILLA)
|
||||||
case $VERSION in
|
SERVER="minecraft_server.$VANILLA_VERSION.jar"
|
||||||
LATEST)
|
|
||||||
export VANILLA_VERSION=`wget -O - https://s3.amazonaws.com/Minecraft.Download/versions/versions.json | jsawk -n 'out(this.latest.release)'`
|
|
||||||
;;
|
|
||||||
SNAPSHOT)
|
|
||||||
export VANILLA_VERSION=`wget -O - https://s3.amazonaws.com/Minecraft.Download/versions/versions.json | jsawk -n 'out(this.latest.snapshot)'`
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
export SERVER="minecraft_server.$VANILLA_VERSION"
|
|
||||||
|
|
||||||
if [ ! -e $SERVER ]; then
|
if [ ! -e $SERVER ]; then
|
||||||
echo "Downloading $SERVER ..."
|
echo "Downloading $SERVER ..."
|
||||||
@ -36,18 +41,8 @@ case $TYPE in
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
FORGE)
|
FORGE)
|
||||||
case $VERSION in
|
FORGE_INSTALLER="forge-$VERSION-$FORGE_VERSION-installer.jar"
|
||||||
LATEST)
|
SERVER="forge-$VERSION-$FORGE_VERSION-universal.jar"
|
||||||
export FORGE_VERSION=`wget -O - http://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json \
|
|
||||||
| jsawk -n 'out(this.promos.recommended)'`
|
|
||||||
;;
|
|
||||||
SNAPSHOT)
|
|
||||||
export FORGE_VERSION=`wget -O - http://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json \
|
|
||||||
| jsawk -n 'out(this.promos.latest)'`
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
export FORGE_INSTALLER="forge-$VERSION-$FORGE_VERSION-installer.jar"
|
|
||||||
export SERVER="forge-$VERSION-$FORGE_VERSION-universal.jar"
|
|
||||||
|
|
||||||
if [ ! -e $SERVER ]; then
|
if [ ! -e $SERVER ]; then
|
||||||
echo "Downloading $SERVER ..."
|
echo "Downloading $SERVER ..."
|
||||||
@ -113,4 +108,3 @@ if [ -n "$ICON" -a ! -e server-icon.png ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
exec java $JVM_OPTS -jar $SERVER
|
exec java $JVM_OPTS -jar $SERVER
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user