diff --git a/lgsm/modules/core_functions.sh b/lgsm/modules/core_functions.sh index 9731815476..ff0fe50def 100644 --- a/lgsm/modules/core_functions.sh +++ b/lgsm/modules/core_functions.sh @@ -8,7 +8,7 @@ module_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -modulesversion="v23.3.1" +modulesversion="v23.3.2" # Core diff --git a/lgsm/modules/core_modules.sh b/lgsm/modules/core_modules.sh index 827e62888b..71a3180c07 100644 --- a/lgsm/modules/core_modules.sh +++ b/lgsm/modules/core_modules.sh @@ -8,7 +8,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -modulesversion="v23.3.1" +modulesversion="v23.3.2" # Core diff --git a/lgsm/modules/info_game.sh b/lgsm/modules/info_game.sh index b90033d9c0..d2714ec3ef 100644 --- a/lgsm/modules/info_game.sh +++ b/lgsm/modules/info_game.sh @@ -93,7 +93,7 @@ fn_info_game_json() { else servercfgparse="${servercfgfullpath}" fi - eval "${1}=\"$(jq -r "${2}" "${servercfgfullpath}")\"" + eval "${1}=\"$(jq -r "${2}" "${servercfgparse}")\"" configtype="json" } @@ -1826,15 +1826,15 @@ fn_info_game_samp() { # Parameters: false # Comment: // or /* */ fn_info_game_sb() { - if [ ! -f "${servercfgfullpath}" ]; then - fn_info_game_json "maxplayers" "maxPlayers" - fn_info_game_json "port" "gameServerPort" - fn_info_game_json "queryenabled" "runQueryServer" - fn_info_game_json "queryport" "queryServerPort" - fn_info_game_json "rconenabled" "runRconServer" - fn_info_game_json "rconpassword" "rconServerPassword" - fn_info_game_json "rconport" "rconServerPort" - fn_info_game_json "servername" "serverName" + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_json "maxplayers" ".maxPlayers" + fn_info_game_json "port" ".gameServerPort" + fn_info_game_json "queryenabled" ".runQueryServer" + fn_info_game_json "queryport" ".queryServerPort" + fn_info_game_json "rconenabled" ".runRconServer" + fn_info_game_json "rconpassword" ".rconServerPassword" + fn_info_game_json "rconport" ".rconServerPort" + fn_info_game_json "servername" ".serverName" fi maxplayers="${maxplayers:-"0"}" port="${port:-"0"}" @@ -1954,11 +1954,11 @@ fn_info_game_sof2() { # Filetype: ini fn_info_game_sol() { if [ -f "${servercfgfullpath}" ]; then - fn_info_config_ini "adminpassword" "Admin_Password" - fn_info_config_ini "maxplayers" "Max_Players" - fn_info_config_ini "port" "Port" - fn_info_config_ini "servername" "Server_Name" - fn_info_config_ini "serverpassword" "Game_Password" + fn_info_game_ini "adminpassword" "Admin_Password" + fn_info_game_ini "maxplayers" "Max_Players" + fn_info_game_ini "port" "Port" + fn_info_game_ini "servername" "Server_Name" + fn_info_game_ini "serverpassword" "Game_Password" fi adminpassword="${adminpassword:-"NOT SET"}" maxplayers="${maxplayers:-"0"}" @@ -2019,8 +2019,8 @@ fn_info_game_squad() { fn_info_game_keyvalue_pairs "maxplayers" "MaxPlayers" fi if [ -f "${servercfgdir}/Rcon.cfg" ]; then - fn_info_game_keyvalue_pairs "rconport" "Port" - fn_info_game_keyvalue_pairs "rconpassword" "Password" + fn_info_game_keyvalue_pairs "rconport" "Port" "${servercfgdir}/Rcon.cfg" + fn_info_game_keyvalue_pairs "rconpassword" "Password" "${servercfgdir}/Rcon.cfg" fi maxplayers="${maxplayers:-"0"}" port="${port:-"0"}" @@ -2441,6 +2441,14 @@ fi # Steam Master Server - checks if detected by master server. # Checked after config init, as the queryport is needed if [ -z "${displaymasterserver}" ]; then + # if queryport and port3 are not set then set them to 123456789 + # this is to prevent the query from failing. + if [ -z "${queryport}" ]; then + queryport="123456789" + fi + if [ -z "${port3}" ]; then + port3="123456789" + fi if [ "$(command -v jq 2> /dev/null)" ]; then if [ -n "${ip}" ] && [ -n "${port}" ]; then if [ "${steammaster}" == "true" ] || [ "${commandname}" == "DEV-QUERY-RAW" ]; then @@ -2460,4 +2468,11 @@ if [ -z "${displaymasterserver}" ]; then fi fi fi + # unset the ports if they are set to 123456789 + if [ "${port3}" == "123456789" ]; then + unset port3 + fi + if [ "${queryport}" == "123456789" ]; then + unset queryport + fi fi diff --git a/lgsm/modules/install_squad_license.sh b/lgsm/modules/install_squad_license.sh index 58053e134a..75499f4a06 100644 --- a/lgsm/modules/install_squad_license.sh +++ b/lgsm/modules/install_squad_license.sh @@ -15,9 +15,9 @@ echo -e "Server license is an optional feature for ${gamename} server" fn_script_log_info "Server license is an optional feature for ${gamename} server" echo -e "Get more info and a server license here:" -echo -e "http://forums.joinsquad.com/topic/16519-server-licensing-general-info/" +echo -e "https://squad.fandom.com/wiki/Server_licensing" fn_script_log_info "Get more info and a server license here:" -fn_script_log_info "http://forums.joinsquad.com/topic/16519-server-licensing-general-info/" +fn_script_log_info "https://squad.fandom.com/wiki/Server_licensing" echo -e "" fn_sleep_time echo -e "The Squad server license can be changed by editing ${servercfgdir}/License.cfg." diff --git a/linuxgsm.sh b/linuxgsm.sh index 30531fa754..4e3d27e159 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v23.3.1" +version="v23.3.2" shortname="core" gameservername="core" commandname="CORE" @@ -369,7 +369,8 @@ if [ "${shortname}" == "core" ]; then if [ "${userinput}" == "${gameservername}" ] || [ "${userinput}" == "${gamename}" ] || [ "${userinput}" == "${shortname}" ]; then fn_install_file else - echo -e "[ FAIL ] unknown game server" + echo -e "[ FAIL ] Unknown game server" + exit 1 fi else fn_install_getopt diff --git a/tests/tests_fctrserver.sh b/tests/tests_fctrserver.sh index 6ecaad71a4..f135c98eb8 100644 --- a/tests/tests_fctrserver.sh +++ b/tests/tests_fctrserver.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v23.3.1" +version="v23.3.2" shortname="fctr" gameservername="fctrserver" commandname="CORE" @@ -369,7 +369,7 @@ if [ "${shortname}" == "core" ]; then if [ "${userinput}" == "${gameservername}" ] || [ "${userinput}" == "${gamename}" ] || [ "${userinput}" == "${shortname}" ]; then fn_install_file else - echo -e "[ FAIL ] unknown game server" + echo -e "[ FAIL ] Unknown game server" fi else fn_install_getopt diff --git a/tests/tests_jc2server.sh b/tests/tests_jc2server.sh index 7eb3fe2b2c..2f0204f7b0 100644 --- a/tests/tests_jc2server.sh +++ b/tests/tests_jc2server.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v23.3.1" +version="v23.3.2" shortname="jc2" gameservername="jc2server" commandname="CORE" @@ -370,7 +370,7 @@ if [ "${shortname}" == "core" ]; then if [ "${userinput}" == "${gameservername}" ] || [ "${userinput}" == "${gamename}" ] || [ "${userinput}" == "${shortname}" ]; then fn_install_file else - echo -e "[ FAIL ] unknown game server" + echo -e "[ FAIL ] Unknown game server" fi else fn_install_getopt diff --git a/tests/tests_mcserver.sh b/tests/tests_mcserver.sh index 4275b1f676..38b39e62d9 100644 --- a/tests/tests_mcserver.sh +++ b/tests/tests_mcserver.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v23.3.1" +version="v23.3.2" shortname="mc" gameservername="mcserver" commandname="CORE" @@ -370,7 +370,7 @@ if [ "${shortname}" == "core" ]; then if [ "${userinput}" == "${gameservername}" ] || [ "${userinput}" == "${gamename}" ] || [ "${userinput}" == "${shortname}" ]; then fn_install_file else - echo -e "[ FAIL ] unknown game server" + echo -e "[ FAIL ] Unknown game server" fi else fn_install_getopt diff --git a/tests/tests_ts3server.sh b/tests/tests_ts3server.sh index f7f1cfb8c6..d3e73133db 100644 --- a/tests/tests_ts3server.sh +++ b/tests/tests_ts3server.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v23.3.1" +version="v23.3.2" shortname="ts3" gameservername="ts3server" commandname="CORE" @@ -370,7 +370,7 @@ if [ "${shortname}" == "core" ]; then if [ "${userinput}" == "${gameservername}" ] || [ "${userinput}" == "${gamename}" ] || [ "${userinput}" == "${shortname}" ]; then fn_install_file else - echo -e "[ FAIL ] unknown game server" + echo -e "[ FAIL ] Unknown game server" fi else fn_install_getopt