1515
1616# Debugging
1717if [ -f " .dev-debug" ]; then
18- exec 5> dev-debug.log
18+ exec 5> dev-debug.log
1919 BASH_XTRACEFD=" 5"
2020 set -x
2121fi
@@ -52,17 +52,17 @@ userinput2="${2}"
5252[ -n " ${LGSM_GITHUBBRANCH} " ] && githubbranch=" ${LGSM_GITHUBBRANCH} " || githubbranch=" master"
5353
5454# Check that curl is installed before doing anything
55- if [ ! " $( command -v curl 2> /dev/null) " ]; then
55+ if [ ! " $( command -v curl 2> /dev/null) " ]; then
5656 echo -e " [ FAIL ] Curl is not installed"
5757 exit 1
5858fi
5959
6060fn_repo_selector () {
6161 # Check if GitHub is accessible if not fail over to Bitbucket.
62- repocheck=$( curl -s -o /dev/null -w " %{http_code}" " https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/master/linuxgsm.sh" 2> /dev/null)
62+ repocheck=$( curl -s -o /dev/null -w " %{http_code}" " https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/master/linuxgsm.sh" 2> /dev/null)
6363 if [ " ${repocheck} " != " 200" ]; then
6464 echo -e " Selecting repo: GitHub is not accessable. Selecting Bitbucket"
65- repocheck=$( curl -s -o /dev/null -w " %{http_code}" " https://bitbucket.org/GameServerManagers/LinuxGSM/master/linuxgsm.sh" 2> /dev/null)
65+ repocheck=$( curl -s -o /dev/null -w " %{http_code}" " https://bitbucket.org/GameServerManagers/LinuxGSM/raw/ master/linuxgsm.sh" 2> /dev/null)
6666 if [ " ${repocheck} " != " 200" ]; then
6767 echo -e " Selecting repo: Unable to to access GitHub or Bitbucket repositories"
6868 exit 1
@@ -75,9 +75,9 @@ fn_repo_selector() {
7575
7676 # Check that git branch exists.
7777 if [ " ${remotereponame} " == " GitHub" ]; then
78- branchexistscheck=$( curl -s -o /dev/null -w " %{http_code}" " https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${githubbranch} /linuxgsm.sh" 2> /dev/null)
78+ branchexistscheck=$( curl -s -o /dev/null -w " %{http_code}" " https://raw.githubusercontent.com/${githubuser} /${githubrepo} /${githubbranch} /linuxgsm.sh" 2> /dev/null)
7979 else
80- branchexistscheck=$( curl -s -o /dev/null -w " %{http_code}" " https://bitbucket.org/${githubuser} /${githubrepo} /raw/${githubbranch} /linuxgsm.sh" 2> /dev/null)
80+ branchexistscheck=$( curl -s -o /dev/null -w " %{http_code}" " https://bitbucket.org/${githubuser} /${githubrepo} /raw/${githubbranch} /linuxgsm.sh" 2> /dev/null)
8181 fi
8282
8383 if [ " ${branchexistscheck} " != " 200" ]; then
@@ -244,7 +244,7 @@ fn_install_menu_bash() {
244244 while read -r line || [[ -n " ${line} " ]]; do
245245 var=$( echo -e " ${line} " | awk -F " ," ' {print $2 " - " $3}' )
246246 menu_options+=(" ${var} " )
247- done < " ${options} "
247+ done < " ${options} "
248248 menu_options+=(" Cancel" )
249249 select option in " ${menu_options[@]} " ; do
250250 if [ " ${option} " ] && [ " ${option} " != " Cancel" ]; then
@@ -270,7 +270,7 @@ fn_install_menu_whiptail() {
270270 key=$( echo -e " ${line} " | awk -F " ," ' {print $3}' )
271271 val=$( echo -e " ${line} " | awk -F " ," ' {print $2}' )
272272 menu_options+=(" ${val// \" / } " " ${key// \" / } " )
273- done < " ${options} "
273+ done < " ${options} "
274274 OPTION=$( ${menucmd} --title " ${title} " --menu " ${caption} " " ${height} " " ${width} " " ${menuheight} " " ${menu_options[@]} " 3>&1 1>&2 2>&3 )
275275 if [ $? == 0 ]; then
276276 eval " $resultvar =\" ${OPTION} \" "
@@ -294,12 +294,12 @@ fn_install_menu() {
294294 fi
295295 done
296296 case " $( basename " ${menucmd} " ) " in
297- whiptail | dialog)
298- fn_install_menu_whiptail " ${menucmd} " selection " ${title} " " ${caption} " " ${options} " 40 80 30
299- ;;
300- * )
301- fn_install_menu_bash selection " ${title} " " ${caption} " " ${options} "
302- ;;
297+ whiptail | dialog)
298+ fn_install_menu_whiptail " ${menucmd} " selection " ${title} " " ${caption} " " ${options} " 40 80 30
299+ ;;
300+ * )
301+ fn_install_menu_bash selection " ${title} " " ${caption} " " ${options} "
302+ ;;
303303 esac
304304 eval " $resultvar =\" ${selection} \" "
305305}
@@ -382,7 +382,7 @@ if [ "${shortname}" == "core" ]; then
382382 } | column -s $' \t ' -t | more
383383 exit
384384 elif [ " ${userinput} " == " install" ] || [ " ${userinput} " == " i" ]; then
385- tail -n +1 " ${serverlist} " | awk -F " ," ' {print $1 "," $2 "," $3}' > " ${serverlistmenu} "
385+ tail -n +1 " ${serverlist} " | awk -F " ," ' {print $1 "," $2 "," $3}' > " ${serverlistmenu} "
386386 fn_install_menu result " LinuxGSM" " Select game server to install." " ${serverlistmenu} "
387387 userinput=" ${result} "
388388 fn_server_info
0 commit comments