From de0303d21ce1af4d3b160c412e6db3da164af8d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=3D=3DTIM=2E=C2=A9=2EB=20=20=3D=3D?= Date: Sun, 16 Mar 2025 19:18:30 +0100 Subject: [PATCH] Update setup_minecraft_lxc.sh --- setup_minecraft_lxc.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/setup_minecraft_lxc.sh b/setup_minecraft_lxc.sh index 4a6dfe8..01865a8 100644 --- a/setup_minecraft_lxc.sh +++ b/setup_minecraft_lxc.sh @@ -1,30 +1,30 @@ #!/bin/bash -# Minecraft Server Installer for LXC containers on Proxmox +# Minecraft Server Installer for LXC Containers on Proxmox # Tested on Debian 11/12 and Ubuntu 24.04 # Author: TimInTech # Update package lists and install required dependencies apt update && apt upgrade -y -apt install -y openjdk-17-jre-headless screen wget curl jq +apt install -y openjdk-21-jre-headless screen wget curl jq unzip -# Create directory for the Minecraft server +# Create the Minecraft server directory mkdir -p /opt/minecraft && cd /opt/minecraft # Fetch the latest PaperMC version 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') -# Validate if version and build numbers were retrieved +# Validate if the version and build exist if [[ -z "$LATEST_VERSION" || -z "$LATEST_BUILD" ]]; then - echo "❌ ERROR: Unable to fetch the latest PaperMC version. Check https://papermc.io/downloads" + echo "ERROR: Couldn't retrieve the latest PaperMC version. Check https://papermc.io/downloads" exit 1 fi -echo "📥 Downloading PaperMC - Version: $LATEST_VERSION, Build: $LATEST_BUILD" +echo "Downloading PaperMC Version: $LATEST_VERSION, Build: $LATEST_BUILD" wget -O server.jar "https://api.papermc.io/v2/projects/paper/versions/$LATEST_VERSION/builds/$LATEST_BUILD/downloads/paper-$LATEST_VERSION-$LATEST_BUILD.jar" -# Accept the Minecraft EULA +# Accept the EULA echo "eula=true" > eula.txt # Create start script @@ -38,4 +38,4 @@ chmod +x start.sh # Start the server in a detached screen session screen -dmS minecraft ./start.sh -echo "✅ Setup complete! Use 'screen -r minecraft' to access the console." +echo "✅ Minecraft Server setup complete! Use 'screen -r minecraft' to access the console."