Skip to content
Permalink
Browse files

fix(linuxgsm.sh): bug causing serverlist.csv to keep downloading

  • Loading branch information...
dgibbs64 committed Jun 26, 2019
1 parent 4c493d7 commit b873a83dc3c97a15ad7cd689c859ae2353b1d153
Showing with 11 additions and 7 deletions.
  1. +11 −7 linuxgsm.sh
@@ -258,6 +258,15 @@ fn_install_file(){
exit
}

fn_dl_serverlist(){
# Download the latest serverlist. This is the complete list of all supported servers.
fn_bootstrap_fetch_file_github "lgsm/data" "serverlist.csv" "${datadir}" "nochmodx" "norun" "forcedl" "nomd5"
if [ ! -f "${serverlist}" ]; then
echo "[ FAIL ] serverlist.csv could not be loaded."
exit 1
fi
}

# Prevent LinuxGSM from running as root. Except if doing a dependency install.
if [ "$(whoami)" == "root" ]; then
if [ "${userinput}" == "install" ]||[ "${userinput}" == "auto-install" ]||[ "${userinput}" == "i" ]||[ "${userinput}" == "ai" ]; then
@@ -274,21 +283,16 @@ if [ "$(whoami)" == "root" ]; then
fi
fi

# Download the latest serverlist. This is the complete list of all supported servers.
fn_bootstrap_fetch_file_github "lgsm/data" "serverlist.csv" "${datadir}" "nochmodx" "norun" "forcedl" "nomd5"
if [ ! -f "${serverlist}" ]; then
echo "[ FAIL ] serverlist.csv could not be loaded."
exit 1
fi

# LinuxGSM installer mode.
if [ "${shortname}" == "core" ]; then
if [ "${userinput}" == "list" ]||[ "${userinput}" == "l" ]; then
fn_dl_serverlist
{
tail -n +2 "${serverlist}" | awk -F "," '{print $2 "\t" $3}'
} | column -s $'\t' -t | more
exit
elif [ "${userinput}" == "install" ]||[ "${userinput}" == "i" ]; then
fn_dl_serverlist
tail -n +2 "${serverlist}" | awk -F "," '{print $1 "," $2 "," $3}' > "${serverlistmenu}"
fn_install_menu result "LinuxGSM" "Select game server to install." "${serverlistmenu}"
userinput="${result}"

0 comments on commit b873a83

Please sign in to comment.
You can’t perform that action at this time.