File tree Expand file tree Collapse file tree 6 files changed +16
-12
lines changed Expand file tree Collapse file tree 6 files changed +16
-12
lines changed Original file line number Diff line number Diff line change 1+ * text =auto
Original file line number Diff line number Diff line change 11#! /bin/bash
2+ set -euo pipefail
23echo " Manual Bedrock update required. Visit official Mojang page to download."
Original file line number Diff line number Diff line change 44# Tested on Debian 11/12 and Ubuntu 24.04
55# Author: TimInTech
66
7- set -e # Exit on any error
7+ set -euo pipefail # Exit on error, unset variable, or failed pipeline
88
99# Install required dependencies
1010sudo apt update && sudo apt upgrade -y
1111sudo apt install -y unzip wget screen curl
1212
1313# Set up server directory
1414sudo mkdir -p /opt/minecraft-bedrock
15- sudo chown $( whoami) : $( whoami) /opt/minecraft-bedrock
15+ sudo chown " $( whoami) " : " $( whoami) " /opt/minecraft-bedrock
1616cd /opt/minecraft-bedrock
1717
1818# Fetch the latest Bedrock server URL
@@ -25,10 +25,7 @@ if [[ -z "$LATEST_URL" ]]; then
2525fi
2626
2727echo " Downloading Minecraft Bedrock Server from: $LATEST_URL "
28- wget -O bedrock-server.zip " $LATEST_URL "
29-
30- # Check if the download was successful
31- if [[ $? -ne 0 ]]; then
28+ if ! wget -O bedrock-server.zip " $LATEST_URL " ; then
3229 echo " ERROR: Download failed. Check your internet connection."
3330 exit 1
3431fi
Original file line number Diff line number Diff line change 44# Tested on Debian 11/12 and Ubuntu 24.04
55# Author: TimInTech
66
7- set -e # Exit script on error
7+ set -euo pipefail # Exit script on error, undefined variable, or failed pipeline
88
99# Install required dependencies
1010sudo apt update && sudo apt upgrade -y
1818
1919# Set up server directory
2020sudo mkdir -p /opt/minecraft
21- sudo chown $( whoami) : $( whoami) /opt/minecraft
21+ sudo chown " $( whoami) " : " $( whoami) " /opt/minecraft
2222cd /opt/minecraft
2323
2424# Fetch the latest PaperMC version
2525LATEST_VERSION=$( curl -s https://api.papermc.io/v2/projects/paper | jq -r ' .versions | last' )
26- LATEST_BUILD=$( curl -s https://api.papermc.io/v2/projects/paper/versions/$LATEST_VERSION | jq -r ' .builds | last' )
26+ LATEST_BUILD=$( curl -s https://api.papermc.io/v2/projects/paper/versions/" $LATEST_VERSION " | jq -r ' .builds | last' )
2727
2828# Validate if version and build numbers were retrieved
2929if [[ -z " $LATEST_VERSION " || -z " $LATEST_BUILD " ]]; then
Original file line number Diff line number Diff line change 44# Tested on Debian 11/12 and Ubuntu 24.04
55# Author: TimInTech
66
7+
8+ set -euo pipefail
9+
710# Update package lists and install required dependencies
811apt update && apt upgrade -y
912apt install -y screen wget curl jq unzip
@@ -15,11 +18,11 @@ if ! apt install -y openjdk-21-jre-headless; then
1518fi
1619
1720# Create the Minecraft server directory
18- mkdir -p /opt/minecraft && cd /opt/minecraft
21+ mkdir -p /opt/minecraft && cd /opt/minecraft || exit
1922
2023# Fetch the latest PaperMC version
2124LATEST_VERSION=$( curl -s https://api.papermc.io/v2/projects/paper | jq -r ' .versions | last' )
22- LATEST_BUILD=$( curl -s https://api.papermc.io/v2/projects/paper/versions/$LATEST_VERSION | jq -r ' .builds | last' )
25+ LATEST_BUILD=$( curl -s https://api.papermc.io/v2/projects/paper/versions/" $LATEST_VERSION " | jq -r ' .builds | last' )
2326
2427# Validate if the version and build exist
2528if [[ -z " $LATEST_VERSION " || -z " $LATEST_BUILD " ]]; then
Original file line number Diff line number Diff line change 11#! /bin/bash
22
3+ set -euo pipefail
4+
35cd /opt/minecraft || exit 1
46
57LATEST_VERSION=$( curl -s https://api.papermc.io/v2/projects/paper | jq -r ' .versions | last' )
6- LATEST_BUILD=$( curl -s https://api.papermc.io/v2/projects/paper/versions/$LATEST_VERSION | jq -r ' .builds | last' )
8+ LATEST_BUILD=$( curl -s https://api.papermc.io/v2/projects/paper/versions/" $LATEST_VERSION " | jq -r ' .builds | last' )
79
810wget -O server.jar " https://api.papermc.io/v2/projects/paper/versions/$LATEST_VERSION /builds/$LATEST_BUILD /downloads/paper-$LATEST_VERSION -$LATEST_BUILD .jar"
911
You can’t perform that action at this time.
0 commit comments