|
@@ -15,7 +15,7 @@
|
|
|
|
|
|
|
|
# Debugging
|
|
# Debugging
|
|
|
if [ -f ".dev-debug" ]; then
|
|
if [ -f ".dev-debug" ]; then
|
|
|
- exec 5> dev-debug.log
|
|
|
|
|
|
|
+ exec 5>dev-debug.log
|
|
|
BASH_XTRACEFD="5"
|
|
BASH_XTRACEFD="5"
|
|
|
set -x
|
|
set -x
|
|
|
fi
|
|
fi
|
|
@@ -52,7 +52,7 @@ userinput2="${2}"
|
|
|
[ -n "${LGSM_GITHUBBRANCH}" ] && githubbranch="${LGSM_GITHUBBRANCH}" || githubbranch="master"
|
|
[ -n "${LGSM_GITHUBBRANCH}" ] && githubbranch="${LGSM_GITHUBBRANCH}" || githubbranch="master"
|
|
|
|
|
|
|
|
# Check that curl is installed before doing anything
|
|
# Check that curl is installed before doing anything
|
|
|
-if [ ! "$(command -v curl 2> /dev/null)" ]; then
|
|
|
|
|
|
|
+if [ ! "$(command -v curl 2>/dev/null)" ]; then
|
|
|
echo -e "[ FAIL ] Curl is not installed"
|
|
echo -e "[ FAIL ] Curl is not installed"
|
|
|
exit 1
|
|
exit 1
|
|
|
fi
|
|
fi
|
|
@@ -213,7 +213,7 @@ fn_install_menu_bash() {
|
|
|
while read -r line || [[ -n "${line}" ]]; do
|
|
while read -r line || [[ -n "${line}" ]]; do
|
|
|
var=$(echo -e "${line}" | awk -F "," '{print $2 " - " $3}')
|
|
var=$(echo -e "${line}" | awk -F "," '{print $2 " - " $3}')
|
|
|
menu_options+=("${var}")
|
|
menu_options+=("${var}")
|
|
|
- done < "${options}"
|
|
|
|
|
|
|
+ done <"${options}"
|
|
|
menu_options+=("Cancel")
|
|
menu_options+=("Cancel")
|
|
|
select option in "${menu_options[@]}"; do
|
|
select option in "${menu_options[@]}"; do
|
|
|
if [ "${option}" ] && [ "${option}" != "Cancel" ]; then
|
|
if [ "${option}" ] && [ "${option}" != "Cancel" ]; then
|
|
@@ -239,7 +239,7 @@ fn_install_menu_whiptail() {
|
|
|
key=$(echo -e "${line}" | awk -F "," '{print $3}')
|
|
key=$(echo -e "${line}" | awk -F "," '{print $3}')
|
|
|
val=$(echo -e "${line}" | awk -F "," '{print $2}')
|
|
val=$(echo -e "${line}" | awk -F "," '{print $2}')
|
|
|
menu_options+=("${val//\"/}" "${key//\"/}")
|
|
menu_options+=("${val//\"/}" "${key//\"/}")
|
|
|
- done < "${options}"
|
|
|
|
|
|
|
+ done <"${options}"
|
|
|
OPTION=$(${menucmd} --title "${title}" --menu "${caption}" "${height}" "${width}" "${menuheight}" "${menu_options[@]}" 3>&1 1>&2 2>&3)
|
|
OPTION=$(${menucmd} --title "${title}" --menu "${caption}" "${height}" "${width}" "${menuheight}" "${menu_options[@]}" 3>&1 1>&2 2>&3)
|
|
|
if [ $? == 0 ]; then
|
|
if [ $? == 0 ]; then
|
|
|
eval "$resultvar=\"${OPTION}\""
|
|
eval "$resultvar=\"${OPTION}\""
|
|
@@ -263,12 +263,12 @@ fn_install_menu() {
|
|
|
fi
|
|
fi
|
|
|
done
|
|
done
|
|
|
case "$(basename "${menucmd}")" in
|
|
case "$(basename "${menucmd}")" in
|
|
|
- whiptail | dialog)
|
|
|
|
|
- fn_install_menu_whiptail "${menucmd}" selection "${title}" "${caption}" "${options}" 40 80 30
|
|
|
|
|
- ;;
|
|
|
|
|
- *)
|
|
|
|
|
- fn_install_menu_bash selection "${title}" "${caption}" "${options}"
|
|
|
|
|
- ;;
|
|
|
|
|
|
|
+ whiptail | dialog)
|
|
|
|
|
+ fn_install_menu_whiptail "${menucmd}" selection "${title}" "${caption}" "${options}" 40 80 30
|
|
|
|
|
+ ;;
|
|
|
|
|
+ *)
|
|
|
|
|
+ fn_install_menu_bash selection "${title}" "${caption}" "${options}"
|
|
|
|
|
+ ;;
|
|
|
esac
|
|
esac
|
|
|
eval "$resultvar=\"${selection}\""
|
|
eval "$resultvar=\"${selection}\""
|
|
|
}
|
|
}
|
|
@@ -321,7 +321,7 @@ fn_install_file() {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
# Prevent LinuxGSM from running as root. Except if doing a dependency install.
|
|
# Prevent LinuxGSM from running as root. Except if doing a dependency install.
|
|
|
-if [ "$(whoami)" == "root" ]; then
|
|
|
|
|
|
|
+if [ "$(whoami)" == "root" ] && [ ! -f /.dockerenv ]; then
|
|
|
if [ "${userinput}" == "install" ] || [ "${userinput}" == "auto-install" ] || [ "${userinput}" == "i" ] || [ "${userinput}" == "ai" ]; then
|
|
if [ "${userinput}" == "install" ] || [ "${userinput}" == "auto-install" ] || [ "${userinput}" == "i" ] || [ "${userinput}" == "ai" ]; then
|
|
|
if [ "${shortname}" == "core" ]; then
|
|
if [ "${shortname}" == "core" ]; then
|
|
|
echo -e "[ FAIL ] Do NOT run this script as root!"
|
|
echo -e "[ FAIL ] Do NOT run this script as root!"
|
|
@@ -351,7 +351,7 @@ if [ "${shortname}" == "core" ]; then
|
|
|
} | column -s $'\t' -t | more
|
|
} | column -s $'\t' -t | more
|
|
|
exit
|
|
exit
|
|
|
elif [ "${userinput}" == "install" ] || [ "${userinput}" == "i" ]; then
|
|
elif [ "${userinput}" == "install" ] || [ "${userinput}" == "i" ]; then
|
|
|
- tail -n +1 "${serverlist}" | awk -F "," '{print $1 "," $2 "," $3}' > "${serverlistmenu}"
|
|
|
|
|
|
|
+ tail -n +1 "${serverlist}" | awk -F "," '{print $1 "," $2 "," $3}' >"${serverlistmenu}"
|
|
|
fn_install_menu result "LinuxGSM" "Select game server to install." "${serverlistmenu}"
|
|
fn_install_menu result "LinuxGSM" "Select game server to install." "${serverlistmenu}"
|
|
|
userinput="${result}"
|
|
userinput="${result}"
|
|
|
fn_server_info
|
|
fn_server_info
|