2022-11-28 14:10:55 +08:00
|
|
|
#!/bin/sh
|
2021-03-14 11:14:13 +01:00
|
|
|
|
|
|
|
|
cd /opt/data || exit 1
|
|
|
|
|
|
2024-04-15 07:48:04 +01:00
|
|
|
echo "platform is ${MCC_PLATFORM}"
|
|
|
|
|
|
2023-09-24 11:39:09 +02:00
|
|
|
if [ -e "./MinecraftClient" -a -n "$MCC_SKIP_REDOWNLOAD" ]; then
|
|
|
|
|
echo "Skip re-download MinecraftClient"
|
|
|
|
|
else
|
|
|
|
|
# Use the provided version tag or get the latest release tag
|
|
|
|
|
RELEASE_TAG=${MCC_VERSION:-$(curl -s -v https://github.com/MCCTeam/Minecraft-Console-Client/releases/latest 2>&1 | grep -i location: | tr -d '\r' | cut -d/ -f8)}
|
2021-03-14 11:14:13 +01:00
|
|
|
|
2023-09-24 11:39:09 +02:00
|
|
|
# Delete the old build
|
|
|
|
|
[ -e MinecraftClient-linux.zip ] && rm -- MinecraftClient-linux.zip
|
|
|
|
|
[ -e MinecraftClient ] && rm -- MinecraftClient
|
2021-03-14 11:14:13 +01:00
|
|
|
|
2023-09-24 11:39:09 +02:00
|
|
|
echo "Donwloading MinecraftClient for ${RELEASE_TAG}"
|
2022-08-19 21:22:54 +02:00
|
|
|
|
2023-09-24 11:39:09 +02:00
|
|
|
# Download the specified build or the latest one
|
2024-04-15 07:48:04 +01:00
|
|
|
curl -L https://github.com/MCCTeam/Minecraft-Console-Client/releases/download/${RELEASE_TAG}/MinecraftClient-${MCC_PLATFORM:=linux}.zip --output MinecraftClient-linux.zip
|
2022-08-19 21:22:54 +02:00
|
|
|
|
2023-09-24 11:39:09 +02:00
|
|
|
# Unzip it
|
|
|
|
|
unzip MinecraftClient-linux.zip
|
|
|
|
|
|
|
|
|
|
# Remove the ZIP
|
|
|
|
|
rm -- MinecraftClient-linux.zip
|
|
|
|
|
fi
|
2022-08-19 21:22:54 +02:00
|
|
|
|
2022-12-23 12:51:11 -07:00
|
|
|
# Set Executable
|
2022-12-24 13:45:13 -08:00
|
|
|
chmod +x ./MinecraftClient
|
2022-12-23 12:51:11 -07:00
|
|
|
|
2022-08-19 21:22:54 +02:00
|
|
|
# Start the Client
|
|
|
|
|
./MinecraftClient
|