Browse Source

fix(update-lgsm): will force check_version.sh to download

this fix will help older versions of LinuxGSM transition to v20.3.0 and above by forcing check_version.sh to download if missing
pull/2900/head
Daniel Gibbs 5 years ago
parent
commit
d908637965
  1. 7
      lgsm/functions/core_dl.sh
  2. 13
      lgsm/functions/core_legacy.sh

7
lgsm/functions/core_dl.sh

@ -236,7 +236,12 @@ fn_fetch_file(){
fn_fetch_file_github(){
github_file_url_dir="${1}"
github_file_url_name="${2}"
if [ "${githubbranch}" == "master" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then
if [ "${legacycheckversionfix}" == "1" ]; then
# For legacy versions - code can be removed at a future date
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}"
elif [ "${githubbranch}" == "master" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then
remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_file_url_dir}/${github_file_url_name}"
remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_file_url_dir}/${github_file_url_name}"
else

13
lgsm/functions/core_legacy.sh

@ -6,6 +6,19 @@
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
# This is to help the transition to v20.3.0 and above
if [ ! -f "${functionsdir}/check_version.sh" ]; then
legacy_versions_array=( v20.2.1 v20.2.0 v20.1.5 v20.1.4 v20.1.3 v20.1.2 v20.1.1 v20.1.0 v19.12.5 v19.12.4 v19.12.3 v19.12.2 v19.12.1 v19.12.0 )
for legacy_version in "${legacy_versions_array[@]}"
do
if [ "${version}" == "${legacy_version}" ]; then
legacycheckversionfix=1
github_file_url_dir="lgsm/functions"
fn_fetch_file_github "${github_file_url_dir}" "check_version.sh" "${functionsdir}" "nochmodx" "norun" "noforce" "nomd5"
fi
done
fi
if [ -z "${serverfiles}" ]; then
legacymode=1
serverfiles="${filesdir}"

Loading…
Cancel
Save