From dc12045194f9e3e295c998f1807291d17cdf740f Mon Sep 17 00:00:00 2001 From: HotoCocoaco Date: Fri, 5 Apr 2024 17:31:20 +0800 Subject: [PATCH] abort raw.githubusercontents.com --- lgsm/functions/alert_discord.sh | 4 ++-- lgsm/functions/core_dl.sh | 22 +++++++++++----------- lgsm/functions/install_config.sh | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/lgsm/functions/alert_discord.sh b/lgsm/functions/alert_discord.sh index 14c5ce8116..8c5d411b23 100644 --- a/lgsm/functions/alert_discord.sh +++ b/lgsm/functions/alert_discord.sh @@ -11,13 +11,13 @@ json=$( cat << EOF { "username":"LinuxGSM", - "avatar_url":"https://raw.githubusercontents.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.jpg", + "avatar_url":"https://raw.gitmirror.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.jpg", "file":"content", "embeds": [{ "color": "2067276", "author": { "name": "${alertemoji} ${alertsubject} ${alertemoji}", - "icon_url": "https://raw.githubusercontents.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.jpg" + "icon_url": "https://raw.gitmirror.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.jpg" }, "title": "${servername}", "description": "${alertbody} \n More info: ${alerturl}", diff --git a/lgsm/functions/core_dl.sh b/lgsm/functions/core_dl.sh index 357d280c1f..679431ea83 100644 --- a/lgsm/functions/core_dl.sh +++ b/lgsm/functions/core_dl.sh @@ -474,14 +474,14 @@ fn_fetch_file_github() { github_fileurl_name="${2}" # For legacy versions - code can be removed at a future date if [ "${legacymode}" == "1" ]; then - remote_fileurl="https://raw.githubusercontents.com/${githubuser}/${githubrepo}/${githubbranch}/${github_fileurl_dir}/${github_fileurl_name}" + remote_fileurl="https://raw.gitmirror.com/${githubuser}/${githubrepo}/${githubbranch}/${github_fileurl_dir}/${github_fileurl_name}" remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_fileurl_dir}/${github_fileurl_name}" # If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork. elif [ "${githubbranch}" == "master" ] && [ "${githubuser}" == "GameServerManager" ] && [ "${commandname}" != "UPDATE-LGSM" ]; then - remote_fileurl="https://raw.githubusercontents.com/${githubuser}/${githubrepo}/${version}/${github_fileurl_dir}/${github_fileurl_name}" + remote_fileurl="https://raw.gitmirror.com/${githubuser}/${githubrepo}/${version}/${github_fileurl_dir}/${github_fileurl_name}" remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_fileurl_dir}/${github_fileurl_name}" else - remote_fileurl="https://raw.githubusercontents.com/${githubuser}/${githubrepo}/${githubbranch}/${github_fileurl_dir}/${github_fileurl_name}" + remote_fileurl="https://raw.gitmirror.com/${githubuser}/${githubrepo}/${githubbranch}/${github_fileurl_dir}/${github_fileurl_name}" remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_fileurl_dir}/${github_fileurl_name}" fi remote_fileurl_name="GitHub" @@ -500,10 +500,10 @@ fn_check_file_github() { github_fileurl_dir="${1}" github_fileurl_name="${2}" if [ "${githubbranch}" == "master" ] && [ "${githubuser}" == "GameServerManager" ] && [ "${commandname}" != "UPDATE-LGSM" ]; then - remote_fileurl="https://raw.githubusercontents.com/${githubuser}/${githubrepo}/${version}/${github_fileurl_dir}/${github_fileurl_name}" + remote_fileurl="https://raw.gitmirror.com/${githubuser}/${githubrepo}/${version}/${github_fileurl_dir}/${github_fileurl_name}" remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_fileurl_dir}/${github_fileurl_name}" else - remote_fileurl="https://raw.githubusercontents.com/${githubuser}/${githubrepo}/${githubbranch}/${github_fileurl_dir}/${github_fileurl_name}" + remote_fileurl="https://raw.gitmirror.com/${githubuser}/${githubrepo}/${githubbranch}/${github_fileurl_dir}/${github_fileurl_name}" remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_fileurl_dir}/${github_fileurl_name}" fi remote_fileurl_name="GitHub" @@ -517,10 +517,10 @@ fn_fetch_config() { github_fileurl_name="${2}" # If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork. if [ "${githubbranch}" == "master" ] && [ "${githubuser}" == "GameServerManager" ] && [ "${commandname}" != "UPDATE-LGSM" ]; then - remote_fileurl="https://raw.githubusercontents.com/${githubuser}/${githubrepo}/${version}/${github_fileurl_dir}/${github_fileurl_name}" + remote_fileurl="https://raw.gitmirror.com/${githubuser}/${githubrepo}/${version}/${github_fileurl_dir}/${github_fileurl_name}" remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_fileurl_dir}/${github_fileurl_name}" else - remote_fileurl="https://raw.githubusercontents.com/${githubuser}/${githubrepo}/${githubbranch}/${github_fileurl_dir}/${github_fileurl_name}" + remote_fileurl="https://raw.gitmirror.com/${githubuser}/${githubrepo}/${githubbranch}/${github_fileurl_dir}/${github_fileurl_name}" remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_fileurl_dir}/${github_fileurl_name}" fi remote_fileurl_name="GitHub" @@ -541,10 +541,10 @@ fn_fetch_function() { github_fileurl_name="${functionfile}" # If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork. if [ "${githubbranch}" == "master" ] && [ "${githubuser}" == "GameServerManager" ] && [ "${commandname}" != "UPDATE-LGSM" ]; then - remote_fileurl="https://raw.githubusercontents.com/${githubuser}/${githubrepo}/${version}/${github_fileurl_dir}/${github_fileurl_name}" + remote_fileurl="https://raw.gitmirror.com/${githubuser}/${githubrepo}/${version}/${github_fileurl_dir}/${github_fileurl_name}" remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_fileurl_dir}/${github_fileurl_name}" else - remote_fileurl="https://raw.githubusercontents.com/${githubuser}/${githubrepo}/${githubbranch}/${github_fileurl_dir}/${github_fileurl_name}" + remote_fileurl="https://raw.gitmirror.com/${githubuser}/${githubrepo}/${githubbranch}/${github_fileurl_dir}/${github_fileurl_name}" remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_fileurl_dir}/${github_fileurl_name}" fi remote_fileurl_name="GitHub" @@ -565,10 +565,10 @@ fn_update_function() { github_fileurl_name="${functionfile}" # If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork. if [ "${githubbranch}" == "master" ] && [ "${githubuser}" == "GameServerManager" ] && [ "${commandname}" != "UPDATE-LGSM" ]; then - remote_fileurl="https://raw.githubusercontents.com/${githubuser}/${githubrepo}/${version}/${github_fileurl_dir}/${github_fileurl_name}" + remote_fileurl="https://raw.gitmirror.com/${githubuser}/${githubrepo}/${version}/${github_fileurl_dir}/${github_fileurl_name}" remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_fileurl_dir}/${github_fileurl_name}" else - remote_fileurl="https://raw.githubusercontents.com/${githubuser}/${githubrepo}/${githubbranch}/${github_fileurl_dir}/${github_fileurl_name}" + remote_fileurl="https://raw.gitmirror.com/${githubuser}/${githubrepo}/${githubbranch}/${github_fileurl_dir}/${github_fileurl_name}" remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_fileurl_dir}/${github_fileurl_name}" fi remote_fileurl_name="GitHub" diff --git a/lgsm/functions/install_config.sh b/lgsm/functions/install_config.sh index 4d319d7ea1..c844333a96 100644 --- a/lgsm/functions/install_config.sh +++ b/lgsm/functions/install_config.sh @@ -24,7 +24,7 @@ fn_fetch_default_config() { echo -e "default configs from https://github.com/GameServerManagers/Game-Server-Configs" fn_sleep_time mkdir -p "${lgsmdir}/config-default/config-game" - githuburl="https://raw.githubusercontents.com/GameServerManagers/Game-Server-Configs/master" + githuburl="https://raw.gitmirror.com/GameServerManagers/Game-Server-Configs/master" for config in "${array_configs[@]}"; do fn_fetch_file "${githuburl}/${gamedirname}/${config}" "${remote_fileurl_backup}" "GitHub" "Bitbucket" "${lgsmdir}/config-default/config-game" "${config}" "nochmodx" "norun" "forcedl" "nohash" done