15
15
16
16
# Debugging
17
17
if [ -f " .dev-debug" ]; then
18
- exec 5> dev-debug.log
18
+ exec 5> dev-debug.log
19
19
BASH_XTRACEFD=" 5"
20
20
set -x
21
21
fi
@@ -52,17 +52,17 @@ userinput2="${2}"
52
52
[ -n " ${LGSM_GITHUBBRANCH} " ] && githubbranch=" ${LGSM_GITHUBBRANCH} " || githubbranch=" master"
53
53
54
54
# 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
56
56
echo -e " [ FAIL ] Curl is not installed"
57
57
exit 1
58
58
fi
59
59
60
60
fn_repo_selector () {
61
61
# 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)
63
63
if [ " ${repocheck} " != " 200" ]; then
64
64
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)
66
66
if [ " ${repocheck} " != " 200" ]; then
67
67
echo -e " Selecting repo: Unable to to access GitHub or Bitbucket repositories"
68
68
exit 1
@@ -75,9 +75,9 @@ fn_repo_selector() {
75
75
76
76
# Check that git branch exists.
77
77
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)
79
79
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)
81
81
fi
82
82
83
83
if [ " ${branchexistscheck} " != " 200" ]; then
@@ -244,7 +244,7 @@ fn_install_menu_bash() {
244
244
while read -r line || [[ -n " ${line} " ]]; do
245
245
var=$( echo -e " ${line} " | awk -F " ," ' {print $2 " - " $3}' )
246
246
menu_options+=(" ${var} " )
247
- done < " ${options} "
247
+ done < " ${options} "
248
248
menu_options+=(" Cancel" )
249
249
select option in " ${menu_options[@]} " ; do
250
250
if [ " ${option} " ] && [ " ${option} " != " Cancel" ]; then
@@ -270,7 +270,7 @@ fn_install_menu_whiptail() {
270
270
key=$( echo -e " ${line} " | awk -F " ," ' {print $3}' )
271
271
val=$( echo -e " ${line} " | awk -F " ," ' {print $2}' )
272
272
menu_options+=(" ${val// \" / } " " ${key// \" / } " )
273
- done < " ${options} "
273
+ done < " ${options} "
274
274
OPTION=$( ${menucmd} --title " ${title} " --menu " ${caption} " " ${height} " " ${width} " " ${menuheight} " " ${menu_options[@]} " 3>&1 1>&2 2>&3 )
275
275
if [ $? == 0 ]; then
276
276
eval " $resultvar =\" ${OPTION} \" "
@@ -294,12 +294,12 @@ fn_install_menu() {
294
294
fi
295
295
done
296
296
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
+ ;;
303
303
esac
304
304
eval " $resultvar =\" ${selection} \" "
305
305
}
@@ -382,7 +382,7 @@ if [ "${shortname}" == "core" ]; then
382
382
} | column -s $' \t ' -t | more
383
383
exit
384
384
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} "
386
386
fn_install_menu result " LinuxGSM" " Select game server to install." " ${serverlistmenu} "
387
387
userinput=" ${result} "
388
388
fn_server_info
0 commit comments