From f6a817806e79fac44b1fbfa657be2aca139b9b45 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 17:58:54 +0100 Subject: [PATCH] Update setup_bedrock.sh Updated setup_bedrock.sh: Improved download handling and structure --- setup_bedrock.sh | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/setup_bedrock.sh b/setup_bedrock.sh index ab172fe..8f882df 100644 --- a/setup_bedrock.sh +++ b/setup_bedrock.sh @@ -1,39 +1,39 @@ #!/bin/bash -# Minecraft Bedrock Server Installer for Proxmox (VM & LXC) -# Dynamically fetches the latest Bedrock server version +# Minecraft Bedrock Server Installer for Proxmox LXC/VM +# Tested on Debian 11/12 and Ubuntu 24.04 # Author: TimInTech -# Install Dependencies -apt update && apt install -y unzip wget screen curl +# Update package lists and install required dependencies +apt update && apt upgrade -y +apt install -y unzip wget screen curl -# Create Bedrock Server Directory +# Create directory for the Minecraft Bedrock server mkdir -p /opt/minecraft-bedrock && cd /opt/minecraft-bedrock # Fetch the latest Bedrock Server download URL LATEST_URL=$(curl -s https://www.minecraft.net/en-us/download/server/bedrock | grep -o 'https://minecraft.azureedge.net/bin-linux/bedrock-server-[0-9.]*.zip' | head -1) -# Check if URL was found +# Validate if the URL was retrieved if [[ -z "$LATEST_URL" ]]; then - echo "❌ ERROR: Could not fetch the latest Bedrock server version. Check the official page: https://www.minecraft.net/en-us/download/server/bedrock" - exit 1 + echo "❌ ERROR: Unable to fetch the latest Bedrock Server version. Check https://www.minecraft.net/en-us/download/server/bedrock" + exit 1 fi -echo "🌍 Downloading latest Bedrock Server from: $LATEST_URL" +echo "📥 Downloading Minecraft Bedrock Server from: $LATEST_URL" wget -O bedrock-server.zip "$LATEST_URL" -# Verify the download +# Validate download success if [[ $? -ne 0 ]]; then - echo "❌ ERROR: Download failed. Please check your network or try manually downloading from:" - echo "$LATEST_URL" - exit 1 + echo "❌ ERROR: Download failed. Please check your network connection." + exit 1 fi -# Unzip the downloaded server files +# Extract server files unzip -o bedrock-server.zip rm -f bedrock-server.zip -# Create a start script +# Create start script cat < start.sh #!/bin/bash LD_LIBRARY_PATH=. ./bedrock_server @@ -41,7 +41,7 @@ EOF chmod +x start.sh -# Start the server in a screen session +# Start the server in a detached screen session screen -dmS bedrock ./start.sh -echo "✅ Minecraft Bedrock Server installation complete! Use 'screen -r bedrock' to access the console." +echo "✅ Setup complete! Use 'screen -r bedrock' to access the console."