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,7 +52,7 @@ 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
@@ -213,7 +213,7 @@ fn_install_menu_bash() {
213213 while read -r line || [[ -n " ${line} " ]]; do
214214 var=$( echo -e " ${line} " | awk -F " ," ' {print $2 " - " $3}' )
215215 menu_options+=(" ${var} " )
216- done < " ${options} "
216+ done < " ${options} "
217217 menu_options+=(" Cancel" )
218218 select option in " ${menu_options[@]} " ; do
219219 if [ " ${option} " ] && [ " ${option} " != " Cancel" ]; then
@@ -239,7 +239,7 @@ fn_install_menu_whiptail() {
239239 key=$( echo -e " ${line} " | awk -F " ," ' {print $3}' )
240240 val=$( echo -e " ${line} " | awk -F " ," ' {print $2}' )
241241 menu_options+=(" ${val// \" / } " " ${key// \" / } " )
242- done < " ${options} "
242+ done < " ${options} "
243243 OPTION=$( ${menucmd} --title " ${title} " --menu " ${caption} " " ${height} " " ${width} " " ${menuheight} " " ${menu_options[@]} " 3>&1 1>&2 2>&3 )
244244 if [ $? == 0 ]; then
245245 eval " $resultvar =\" ${OPTION} \" "
@@ -263,12 +263,12 @@ fn_install_menu() {
263263 fi
264264 done
265265 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+ ;;
272272 esac
273273 eval " $resultvar =\" ${selection} \" "
274274}
@@ -321,7 +321,7 @@ fn_install_file() {
321321}
322322
323323# Prevent LinuxGSM from running as root. Except if doing a dependency install.
324- if [ " $( whoami) " == " root" ]; then
324+ if [ " $( whoami) " == " root" ] && [ ! -f /.dockerenv ] ; then
325325 if [ " ${userinput} " == " install" ] || [ " ${userinput} " == " auto-install" ] || [ " ${userinput} " == " i" ] || [ " ${userinput} " == " ai" ]; then
326326 if [ " ${shortname} " == " core" ]; then
327327 echo -e " [ FAIL ] Do NOT run this script as root!"
@@ -351,7 +351,7 @@ if [ "${shortname}" == "core" ]; then
351351 } | column -s $' \t ' -t | more
352352 exit
353353 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} "
355355 fn_install_menu result " LinuxGSM" " Select game server to install." " ${serverlistmenu} "
356356 userinput=" ${result} "
357357 fn_server_info
0 commit comments