From f94b40b3ab678f99fc77bf65cd019032cd7ca425 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 11 Apr 2021 13:07:04 +0100 Subject: [PATCH] integrate ss --- lgsm/functions/info_distro.sh | 3 +++ lgsm/functions/info_messages.sh | 16 ++++++++-------- lgsm/functions/info_parms.sh | 1 - 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/lgsm/functions/info_distro.sh b/lgsm/functions/info_distro.sh index 283d8ed39..1d5befff8 100755 --- a/lgsm/functions/info_distro.sh +++ b/lgsm/functions/info_distro.sh @@ -288,3 +288,6 @@ if [ "${appid}" ]; then glibc="2.14" fi fi + +# Gather Port Info using ss +ssinfo="$(ss -tupl)" diff --git a/lgsm/functions/info_messages.sh b/lgsm/functions/info_messages.sh index 59750a38b..dc049db11 100755 --- a/lgsm/functions/info_messages.sh +++ b/lgsm/functions/info_messages.sh @@ -1077,16 +1077,16 @@ fn_info_message_quakelive(){ } fn_info_message_arma3(){ - echo -e " ss -tupl | grep ${executable//.\/}" + echo -e "ss -tupl | grep ${executable//.\/}" echo -e "" { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> Voice\tINBOUND\t${voiceport}\tudp" - echo -e "> Query Steam\tINBOUND\t${queryport}\tudp" - echo -e "> Steam Master\tINBOUND\t${steammasterport}\tudp" - echo -e "> Voice (unused)\tINBOUND\t${voiceunusedport}\tudp" - echo -e "> BattleEye\tINBOUND\t${battleeyeport}\tudp" + echo -e "${lightblue}DESCRIPTION\tPORT\tPROTOCOL\tSTATUS${default}" + echo -e "Game\t${port}\tudp\t\t$(echo "${ssinfo}" | grep ${port} | wc -l)" + echo -e "Voice\t${voiceport}\tudp\t$(echo "${ssinfo}" | grep ${voiceport}|wc -l)" + echo -e "Query Steam\t${queryport}\tudp\t$(echo "${ssinfo}" | grep ${queryport}|wc -l)" + echo -e "Steam Master\t${steammasterport}\tudp\t$(echo "${ssinfo}" | grep ${steammasterport}|wc -l)" + echo -e "Voice (unused)\t${voiceunusedport}\tudp\t$(echo "${ssinfo}" | grep ${voiceunusedport}|wc -l)" + echo -e "BattleEye\t${battleeyeport}\tudp\t$(echo "${ssinfo}" | grep ${battleeyeport}|wc -l)" } | column -s $'\t' -t } diff --git a/lgsm/functions/info_parms.sh b/lgsm/functions/info_parms.sh index 0ea06e61d..70941da7b 100755 --- a/lgsm/functions/info_parms.sh +++ b/lgsm/functions/info_parms.sh @@ -129,7 +129,6 @@ fn_info_parms_arma3(){ steammasterport=$((port+2)) voiceunusedport=$((port+3)) battleeyeport=$((port+4)) - } fn_info_parms_risingworld(){