From 408ace2b1031b152baf55a01e490f227fa3b5437 Mon Sep 17 00:00:00 2001 From: Botond Hende Date: Mon, 22 Apr 2024 23:29:38 +0200 Subject: initial commit --- papermc_getlatest.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 papermc_getlatest.sh (limited to 'papermc_getlatest.sh') diff --git a/papermc_getlatest.sh b/papermc_getlatest.sh new file mode 100755 index 0000000..f8d0ca9 --- /dev/null +++ b/papermc_getlatest.sh @@ -0,0 +1,13 @@ +PROJECT="paper" +MINECRAFT_VERSION="1.20.4" + +LATEST_BUILD=$(curl -s https://api.papermc.io/v2/projects/${PROJECT}/versions/${MINECRAFT_VERSION}/builds | \ + jq -r '.builds | map(select(.channel == "default") | .build) | .[-1]') + +JAR_NAME=${PROJECT}-${MINECRAFT_VERSION}-${LATEST_BUILD}.jar + +PAPERMC_URL="https://api.papermc.io/v2/projects/${PROJECT}/versions/${MINECRAFT_VERSION}/builds/${LATEST_BUILD}/downloads/${JAR_NAME}" + +# Download the latest PaperMC version +curl -o /opt/minecraft/server.jar $PAPERMC_URL +echo "Downloads completed" -- cgit v1.2.3-70-g09d2