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,7 +52,7 @@ 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
@@ -213,7 +213,7 @@ fn_install_menu_bash() {
213
213
while read -r line || [[ -n " ${line} " ]]; do
214
214
var=$( echo -e " ${line} " | awk -F " ," ' {print $2 " - " $3}' )
215
215
menu_options+=(" ${var} " )
216
- done < " ${options} "
216
+ done < " ${options} "
217
217
menu_options+=(" Cancel" )
218
218
select option in " ${menu_options[@]} " ; do
219
219
if [ " ${option} " ] && [ " ${option} " != " Cancel" ]; then
@@ -239,7 +239,7 @@ fn_install_menu_whiptail() {
239
239
key=$( echo -e " ${line} " | awk -F " ," ' {print $3}' )
240
240
val=$( echo -e " ${line} " | awk -F " ," ' {print $2}' )
241
241
menu_options+=(" ${val// \" / } " " ${key// \" / } " )
242
- done < " ${options} "
242
+ done < " ${options} "
243
243
OPTION=$( ${menucmd} --title " ${title} " --menu " ${caption} " " ${height} " " ${width} " " ${menuheight} " " ${menu_options[@]} " 3>&1 1>&2 2>&3 )
244
244
if [ $? == 0 ]; then
245
245
eval " $resultvar =\" ${OPTION} \" "
@@ -263,12 +263,12 @@ fn_install_menu() {
263
263
fi
264
264
done
265
265
case " $( basename " ${menucmd} " ) " in
266
- whiptail | dialog)
267
- fn_install_menu_whiptail " ${menucmd} " selection " ${title} " " ${caption} " " ${options} " 40 80 30
268
- ;;
269
- * )
270
- fn_install_menu_bash selection " ${title} " " ${caption} " " ${options} "
271
- ;;
266
+ whiptail | dialog)
267
+ fn_install_menu_whiptail " ${menucmd} " selection " ${title} " " ${caption} " " ${options} " 40 80 30
268
+ ;;
269
+ * )
270
+ fn_install_menu_bash selection " ${title} " " ${caption} " " ${options} "
271
+ ;;
272
272
esac
273
273
eval " $resultvar =\" ${selection} \" "
274
274
}
@@ -321,7 +321,7 @@ fn_install_file() {
321
321
}
322
322
323
323
# Prevent LinuxGSM from running as root. Except if doing a dependency install.
324
- if [ " $( whoami) " == " root" ]; then
324
+ if [ " $( whoami) " == " root" ] && [ ! -f /.dockerenv ] ; then
325
325
if [ " ${userinput} " == " install" ] || [ " ${userinput} " == " auto-install" ] || [ " ${userinput} " == " i" ] || [ " ${userinput} " == " ai" ]; then
326
326
if [ " ${shortname} " == " core" ]; then
327
327
echo -e " [ FAIL ] Do NOT run this script as root!"
@@ -351,7 +351,7 @@ if [ "${shortname}" == "core" ]; then
351
351
} | column -s $' \t ' -t | more
352
352
exit
353
353
elif [ " ${userinput} " == " install" ] || [ " ${userinput} " == " i" ]; then
354
- tail -n +1 " ${serverlist} " | awk -F " ," ' {print $1 "," $2 "," $3}' > " ${serverlistmenu} "
354
+ tail -n +1 " ${serverlist} " | awk -F " ," ' {print $1 "," $2 "," $3}' > " ${serverlistmenu} "
355
355
fn_install_menu result " LinuxGSM" " Select game server to install." " ${serverlistmenu} "
356
356
userinput=" ${result} "
357
357
fn_server_info
0 commit comments