Update update.sh
feat: add dynamic PaperMC update.sh with API-based version & build resolution - Uses PaperMC API to fetch latest version and build - Replaces existing server.jar in /opt/minecraft - Includes status output after update - Designed for standalone use by minecraft user
This commit is contained in:
parent
a01ade7b32
commit
a23067e60d
1 changed files with 5 additions and 4 deletions
|
|
@ -1,9 +1,10 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Change to Minecraft directory
|
||||
cd /opt/minecraft || exit 1
|
||||
|
||||
# Download latest PaperMC jar (manually specified version/build for now)
|
||||
wget -O server.jar https://api.papermc.io/v2/projects/paper/versions/1.20.4/builds/416/downloads/paper-1.20.4-416.jar
|
||||
LATEST_VERSION=$(curl -s https://api.papermc.io/v2/projects/paper | jq -r '.versions | last')
|
||||
LATEST_BUILD=$(curl -s https://api.papermc.io/v2/projects/paper/versions/$LATEST_VERSION | jq -r '.builds | last')
|
||||
|
||||
echo "✅ Update complete. Restart the server if needed."
|
||||
wget -O server.jar "https://api.papermc.io/v2/projects/paper/versions/$LATEST_VERSION/builds/$LATEST_BUILD/downloads/paper-$LATEST_VERSION-$LATEST_BUILD.jar"
|
||||
|
||||
echo "✅ Update complete to version $LATEST_VERSION (build $LATEST_BUILD)"
|
||||
|
|
|
|||
Loading…
Reference in a new issue