Daniel Gibbs
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
3 additions and
3 deletions
-
lgsm/functions/update_minecraft_bedrock.sh
|
|
@ -8,10 +8,10 @@ |
|
|
|
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" |
|
|
|
|
|
|
|
#random number for userAgent |
|
|
|
RandNum=$((1 + RANDOM % 5000)) |
|
|
|
randnum=$((1 + RANDOM % 5000)) |
|
|
|
|
|
|
|
fn_update_minecraft_dl(){ |
|
|
|
latestmcbuildurl=$(curl -H "Accept-Encoding: identity" -H "Accept-Language: en" -Ls -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.$RandNum.212 Safari/537.36" "https://www.minecraft.net/en-us/download/server/bedrock/" | grep -o 'https://minecraft.azureedge.net/bin-linux/[^"]*zip') |
|
|
|
latestmcbuildurl=$(curl -H "Accept-Encoding: identity" -H "Accept-Language: en" -Ls -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.${randnum}.212 Safari/537.36" "https://www.minecraft.net/en-us/download/server/bedrock/" | grep -o 'https://minecraft.azureedge.net/bin-linux/[^"]*zip') |
|
|
|
fn_fetch_file "${latestmcbuildurl}" "" "" "" "${tmpdir}" "bedrock_server.${remotebuild}.zip" |
|
|
|
echo -e "Extracting to ${serverfiles}...\c" |
|
|
|
if [ "${firstcommandname}" == "INSTALL" ]; then |
|
|
@ -82,7 +82,7 @@ fn_update_minecraft_localbuild(){ |
|
|
|
|
|
|
|
fn_update_minecraft_remotebuild(){ |
|
|
|
# Gets remote build info. |
|
|
|
remotebuild=$(curl -H "Accept-Encoding: identity" -H "Accept-Language: en" -Ls -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.$RandNum.212 Safari/537.36" "https://www.minecraft.net/en-us/download/server/bedrock/" | grep -o 'https://minecraft.azureedge.net/bin-linux/[^"]*' | sed 's/.*\///' | grep -Eo "[.0-9]+[0-9]") |
|
|
|
remotebuild=$(curl -H "Accept-Encoding: identity" -H "Accept-Language: en" -Ls -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.${randnum}.212 Safari/537.36" "https://www.minecraft.net/en-us/download/server/bedrock/" | grep -o 'https://minecraft.azureedge.net/bin-linux/[^"]*' | sed 's/.*\///' | grep -Eo "[.0-9]+[0-9]") |
|
|
|
if [ "${firstcommandname}" != "INSTALL" ]; then |
|
|
|
fn_print_dots "Checking remote build: ${remotelocation}" |
|
|
|
# Checks if remotebuild variable has been set. |
|
|
|