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
|
|
|
|
2024-08-14 18:22:05 +08:00
|
|
|
# Taken from https://stackoverflow.com/a/70369688
|
|
|
|
|
ARCH=$(arch | sed s/aarch64/arm64/ | sed s/x86_64/x64/)
|
|
|
|
|
|
2023-09-24 11:39:09 +02:00
|
|
|
# Delete the old build
|
|
|
|
|
[ -e MinecraftClient ] && rm -- MinecraftClient
|
2021-03-14 11:14:13 +01:00
|
|
|
|
2024-08-14 18:22:05 +08:00
|
|
|
echo "Donwloading MinecraftClient for ${RELEASE_TAG}-${ARCH}"
|
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-08-14 18:22:05 +08:00
|
|
|
curl -L https://github.com/MCCTeam/Minecraft-Console-Client/releases/download/${RELEASE_TAG}/MinecraftClient-${RELEASE_TAG}-${MCC_PLATFORM:=linux}-${ARCH} --output MinecraftClient
|
2023-09-24 11:39:09 +02:00
|
|
|
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
|