Browse Source

remove requirement for backup url as now tested first

pull/4170/head
Daniel Gibbs 2 years ago
parent
commit
cf7e9d9d99
No known key found for this signature in database GPG Key ID: 7CA38B43F78F12FE
  1. 25
      linuxgsm.sh

25
linuxgsm.sh

@ -84,12 +84,10 @@ fn_repo_selector() {
echo -e "${githubbranch} branch does not exist. Defaulting to master branch." echo -e "${githubbranch} branch does not exist. Defaulting to master branch."
githubbranch="master" githubbranch="master"
fi fi
} }
# Fetches the core module required before passed off to core_dl.sh. # Fetches the core module required before passed off to core_dl.sh.
core_modules.sh() { core_modules.sh() {
fn_repo_selector
modulefile="${FUNCNAME[0]}" modulefile="${FUNCNAME[0]}"
fn_bootstrap_fetch_file_github "lgsm/modules" "core_modules.sh" "${modulesdir}" "chmodx" "run" "noforcedl" "nomd5" fn_bootstrap_fetch_file_github "lgsm/modules" "core_modules.sh" "${modulesdir}" "chmodx" "run" "noforcedl" "nomd5"
} }
@ -196,18 +194,25 @@ fn_bootstrap_fetch_file() {
} }
fn_bootstrap_fetch_file_github() { fn_bootstrap_fetch_file_github() {
fn_repo_selector
github_file_url_dir="${1}" github_file_url_dir="${1}"
github_file_url_name="${2}" github_file_url_name="${2}"
# By default modules will be downloaded from the version release to prevent potential version mixing. Only update-lgsm will allow an update. # By default modules will be downloaded from the version release to prevent potential version mixing. Only update-lgsm will allow an update.
if [ "${githubbranch}" == "master" ] && [ "${githubuser}" == "GameServerManagers" ] && [ "${commandname}" != "UPDATE-LGSM" ]; then if [ "${remotereponame}" == "GitHub" ]; then
remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_file_url_dir}/${github_file_url_name}" if [ "${githubbranch}" == "master" ] && [ "${githubuser}" == "GameServerManagers" ] && [ "${commandname}" != "UPDATE-LGSM" ]; then
remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_file_url_dir}/${github_file_url_name}" remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_file_url_dir}/${github_file_url_name}"
else else
remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" fi
elif [ "${remotereponame}" == "BitBucket" ]; then
if [ "${githubbranch}" == "master" ] && [ "${githubuser}" == "GameServerManagers" ] && [ "${commandname}" != "UPDATE-LGSM" ]; then
remote_fileurl="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_file_url_dir}/${github_file_url_name}"
else
remote_fileurl="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
fi
fi fi
remote_fileurl_name="GitHub" remote_fileurl_name="GitHub"
remote_fileurl_backup_name="Bitbucket"
local_filedir="${3}" local_filedir="${3}"
local_filename="${github_file_url_name}" local_filename="${github_file_url_name}"
chmodx="${4:-0}" chmodx="${4:-0}"
@ -215,7 +220,7 @@ fn_bootstrap_fetch_file_github() {
forcedl="${6:-0}" forcedl="${6:-0}"
md5="${7:-0}" md5="${7:-0}"
# Passes vars to the file download module. # Passes vars to the file download module.
fn_bootstrap_fetch_file "${remote_fileurl}" "${remote_fileurl_backup}" "${remote_fileurl_name}" "${remote_fileurl_backup_name}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}" fn_bootstrap_fetch_file "${remote_fileurl}" "" "${remote_fileurl_name}" "" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}"
} }
# Installer menu. # Installer menu.

Loading…
Cancel
Save