Skip to content

Instantly share code, notes, and snippets.

@fengye
Created August 9, 2019 20:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fengye/6cc9ac102661176c1ab666e231fb950e to your computer and use it in GitHub Desktop.
Save fengye/6cc9ac102661176c1ab666e231fb950e to your computer and use it in GitHub Desktop.
Find and build latest spigot minecraft server, suitable for daily or periodic build
#!/bin/bash
latest=$(python find_latest_spigot.py)
stored_latest=$(<latest.txt)
echo Last stored Spigot version $stored_latest
if [ $stored_latest == $latest ]; then
echo Latest version $latest remains unchanged, not building.
else
echo Building Spigot version $latest
echo $latest > latest.txt
java -Xmx1024M -jar BuildTools.jar --output-dir ./daily_build/ --rev $latest
fi
#!/usr/bin/python
import requests
url = 'https://mcmirror.io/api/file/spigot/spigot-latest.jar'
resp = requests.get(url = url)
data = resp.json()
print(data["mc_version"])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment