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
10 lines
487 B
Bash
10 lines
487 B
Bash
#!/bin/bash
|
|
|
|
cd /opt/minecraft || exit 1
|
|
|
|
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')
|
|
|
|
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)"
|