Created
December 7, 2013 21:20
-
-
Save jbott/7848922 to your computer and use it in GitHub Desktop.
Script to update minecraft server to latest version, either snapshot or release
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Can be snapshot or release | |
DEFAULTREVISION=release | |
# Pull out latest snapshot version | |
REVISION=${1-$DEFAULTREVISION} | |
REGEX="(?<=$REVISION\": \").*?[^\\\\](?=\")" | |
VERSION=`curl -silent "http://s3.amazonaws.com/Minecraft.Download/versions/versions.json" | grep -Po "$REGEX"` | |
if [ "$VERSION" = "" ]; then | |
echo "Invalid Version"; exit | |
fi | |
URL="https://s3.amazonaws.com/Minecraft.Download/versions/$VERSION/minecraft_server.$VERSION.jar" | |
echo "Version: " $VERSION | |
echo "URL: " $URL | |
# Download the latest version | |
curl -O $URL | |
# Symlink to the server jar | |
if [ -f "minecraft_server.jar" ]; then | |
rm minecraft_server.jar | |
fi | |
ln -s "minecraft_server.$VERSION.jar" minecraft_server.jar |
copy the code down into a text doc named
update.py
then run python3 update.py
They changed the file, I don't think it works anymore.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
how do I use this