From 6a8942e76f3150d63a3a6d8a4a47eb3dc5a9f27a Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Thu, 18 May 2023 11:17:08 +0100 Subject: [PATCH] display ss command output --- lgsm/modules/command_dev_query_raw.sh | 1 + lgsm/modules/info_messages.sh | 17 +++++++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/lgsm/modules/command_dev_query_raw.sh b/lgsm/modules/command_dev_query_raw.sh index 8f1ccd8fb..a2cfa1f68 100644 --- a/lgsm/modules/command_dev_query_raw.sh +++ b/lgsm/modules/command_dev_query_raw.sh @@ -205,6 +205,7 @@ echo -e "" echo -e "${lightgreen}SS Output${default}" echo -e "=================================" fn_info_message_ports +eval "${portcommand}" echo -e "" echo -e "${lightgreen}Query Port - Raw Output${default}" echo -e "==================================================================" diff --git a/lgsm/modules/info_messages.sh b/lgsm/modules/info_messages.sh index d112764c4..cc2463af1 100644 --- a/lgsm/modules/info_messages.sh +++ b/lgsm/modules/info_messages.sh @@ -688,23 +688,24 @@ fn_info_message_ports_edit() { fn_info_message_ports() { echo -e "${lightblue}Useful port diagnostic command:${default}" if [ "${shortname}" == "armar" ]; then - echo -e "ss -tuplwn | grep enfMain" + portcommand="ss -tuplwn | grep enfMain" elif [ "${shortname}" == "av" ]; then - echo -e "ss -tuplwn | grep AvorionServer" + portcommand="ss -tuplwn | grep AvorionServer" elif [ "${shortname}" == "bf1942" ]; then - echo -e "ss -tuplwn | grep bf1942_lnxded" + portcommand="ss -tuplwn | grep bf1942_lnxded" elif [ "${shortname}" == "mc" ] || [ "${shortname}" == "nec" ] || [ "${shortname}" == "pmc" ] || [ "${shortname}" == "rw" ] || [ "${shortname}" == "vpmc" ] || [ "${shortname}" == "wmc" ]; then - echo -e "ss -tuplwn | grep java" + portcommand="ss -tuplwn | grep java" elif [ "${shortname}" == "terraria" ]; then - echo -e "ss -tuplwn | grep Main" + portcommand="ss -tuplwn | grep Main" elif [ "${engine}" == "source" ]; then - echo -e "ss -tuplwn | grep srcds_linux" + portcommand="ss -tuplwn | grep srcds_linux" elif [ "${engine}" == "goldsrc" ]; then - echo -e "ss -tuplwn | grep hlds_linux" + portcommand="ss -tuplwn | grep hlds_linux" else executableshort="$(basename "${executable}" | cut -c -15)" - echo -e "ss -tuplwn | grep ${executableshort}" + portcommand="ss -tuplwn | grep ${executableshort}" fi + echo -e "${portcommand}" echo -e "" }