Skip to content

Commit

Permalink
move
Browse files Browse the repository at this point in the history
  • Loading branch information
dgibbs64 committed Apr 5, 2023
1 parent 9ebac97 commit 424d7ef
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions linuxgsm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,19 @@ fi

# Core module that is required first.
core_modules.sh() {
# Check that git branch exists.
if [ "${remotereponame}" == "GitHub" ]; then
branchexistscheck=$(curl -s -o /dev/null -w "%{http_code}" "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh" 1> /dev/null)
else
branchexistscheck=$(curl -s -o /dev/null -w "%{http_code}" "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh" 1> /dev/null)
fi

if [ "${branchexistscheck}" != "200" ]; then
echo -e "${githubbranch} branch does not exist. Defaulting to master branch."
githubbranch="master"
fi

# Fetches the core modules required before passed off to core_dl.sh.
modulefile="${FUNCNAME[0]}"
fn_bootstrap_fetch_file_github "lgsm/modules" "core_modules.sh" "${modulesdir}" "chmodx" "run" "noforcedl" "nomd5"
}
Expand Down Expand Up @@ -320,18 +333,6 @@ fn_install_file() {
exit
}

# Check that git branch exists.
if [ "${remotereponame}" == "GitHub" ]; then
branchexistscheck=$(curl -s -o /dev/null -w "%{http_code}" "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh" 1> /dev/null)
else
branchexistscheck=$(curl -s -o /dev/null -w "%{http_code}" "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh" 1> /dev/null)
fi

if [ "${branchexistscheck}" != "200" ]; then
echo -e "${githubbranch} branch does not exist. Defaulting to master branch."
githubbranch="master"
fi

# Prevent LinuxGSM from running as root. Except if doing a dependency install.
if [ "$(whoami)" == "root" ] && [ ! -f /.dockerenv ]; then
if [ "${userinput}" == "install" ] || [ "${userinput}" == "auto-install" ] || [ "${userinput}" == "i" ] || [ "${userinput}" == "ai" ]; then
Expand Down

0 comments on commit 424d7ef

Please sign in to comment.