minecraft-server-proxmox/update.sh
==TIM.©.B == a23067e60d
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
2025-06-23 11:06:25 +02:00

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)"