forked from MCCTeam/Minecraft-Console-Client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart-latest.sh
29 lines (20 loc) · 982 Bytes
/
start-latest.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/sh
cd /opt/data || exit 1
echo "platform is ${MCC_PLATFORM}"
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)}
# Taken from https://stackoverflow.com/a/70369688
ARCH=$(arch | sed s/aarch64/arm64/ | sed s/x86_64/x64/)
# Delete the old build
[ -e MinecraftClient ] && rm -- MinecraftClient
echo "Donwloading MinecraftClient for ${RELEASE_TAG}-${ARCH}"
# Download the specified build or the latest one
curl -L https://github.com/MCCTeam/Minecraft-Console-Client/releases/download/${RELEASE_TAG}/MinecraftClient-${RELEASE_TAG}-${MCC_PLATFORM:=linux}-${ARCH} --output MinecraftClient
fi
# Set Executable
chmod +x ./MinecraftClient
# Start the Client
./MinecraftClient