From 36d80115a44b91410a5a49eeef638683cdd341da Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Thu, 2 Sep 2021 21:38:55 +0100 Subject: [PATCH] prevent steamport from showing if not available steamport fix --- lgsm/functions/info_game.sh | 5 ++--- lgsm/functions/info_messages.sh | 6 ++++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lgsm/functions/info_game.sh b/lgsm/functions/info_game.sh index 2c3c52584..4b45ab417 100644 --- a/lgsm/functions/info_game.sh +++ b/lgsm/functions/info_game.sh @@ -1511,12 +1511,11 @@ fn_info_game_source(){ rconport=${port:-"0"} queryport=${port:-"0"} clientport=${clientport:-"0"} - # Steamport can be between 26901-26910 and is normaly automaticly set. + # Steamport can be between 26901-26910 and is normaly automatically set. # Some servers might support -steamport parameter to set - if [ "${steamport}" == "0" ]||[ -z "${steamport}" ]; then + if [ "${steamport}" == "0" ]||[ -v "${steamport}" ]; then steamport="$(echo "${ssinfo}" | grep "${srcdslinuxpid}" | awk '{print $5}' | grep ":269" | cut -d ":" -f2)" fi - steamport="${steamport:-"0"}" } fn_info_game_spark(){ diff --git a/lgsm/functions/info_messages.sh b/lgsm/functions/info_messages.sh index ac429ff28..984db5b80 100755 --- a/lgsm/functions/info_messages.sh +++ b/lgsm/functions/info_messages.sh @@ -1339,8 +1339,10 @@ fn_info_message_source(){ fn_port "Query" queryport tcp fn_port "RCON" rconport tcp fn_port "SourceTV" sourcetvport udp - # not manualy set by default more research needed - fn_port "Steam" steamport udp + # Will not show if unaviable + if [ "${steamport}" == "0" ]||[ -z "${steamport}" ]; then + fn_port "Steam" steamport udp + fi fn_port "Client" clientport udp } | column -s $'\t' -t }