File tree Expand file tree Collapse file tree 1 file changed +13
-12
lines changed Expand file tree Collapse file tree 1 file changed +13
-12
lines changed Original file line number Diff line number Diff line change 5959
6060# Core module that is required first.
6161core_modules.sh () {
62+ # Check that git branch exists.
63+ if [ " ${remotereponame} " == " GitHub" ]; then
64+ branchexistscheck=$( curl -s -o /dev/null -w " %{http_code}" " https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${githubbranch} /linuxgsm.sh" 1> /dev/null)
65+ else
66+ branchexistscheck=$( curl -s -o /dev/null -w " %{http_code}" " https://bitbucket.org/${githubuser} /${githubrepo} /raw/${githubbranch} /linuxgsm.sh" 1> /dev/null)
67+ fi
68+
69+ if [ " ${branchexistscheck} " != " 200" ]; then
70+ echo -e " ${githubbranch} branch does not exist. Defaulting to master branch."
71+ githubbranch=" master"
72+ fi
73+
74+ # Fetches the core modules required before passed off to core_dl.sh.
6275 modulefile=" ${FUNCNAME[0]} "
6376 fn_bootstrap_fetch_file_github " lgsm/modules" " core_modules.sh" " ${modulesdir} " " chmodx" " run" " noforcedl" " nomd5"
6477}
@@ -320,18 +333,6 @@ fn_install_file() {
320333 exit
321334}
322335
323- # Check that git branch exists.
324- if [ " ${remotereponame} " == " GitHub" ]; then
325- branchexistscheck=$( curl -s -o /dev/null -w " %{http_code}" " https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${githubbranch} /linuxgsm.sh" 1> /dev/null)
326- else
327- branchexistscheck=$( curl -s -o /dev/null -w " %{http_code}" " https://bitbucket.org/${githubuser} /${githubrepo} /raw/${githubbranch} /linuxgsm.sh" 1> /dev/null)
328- fi
329-
330- if [ " ${branchexistscheck} " != " 200" ]; then
331- echo -e " ${githubbranch} branch does not exist. Defaulting to master branch."
332- githubbranch=" master"
333- fi
334-
335336# Prevent LinuxGSM from running as root. Except if doing a dependency install.
336337if [ " $( whoami) " == " root" ] && [ ! -f /.dockerenv ]; then
337338 if [ " ${userinput} " == " install" ] || [ " ${userinput} " == " auto-install" ] || [ " ${userinput} " == " i" ] || [ " ${userinput} " == " ai" ]; then
You can’t perform that action at this time.
0 commit comments