From a64c088419c37365d76ee97bc4ca1f63af51f221 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Tue, 16 May 2023 23:30:48 +0100 Subject: [PATCH] minor tweaks --- lgsm/modules/check_ip.sh | 10 +++++----- lgsm/modules/command_dev_query_raw.sh | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lgsm/modules/check_ip.sh b/lgsm/modules/check_ip.sh index a2a16298c..7671429cd 100644 --- a/lgsm/modules/check_ip.sh +++ b/lgsm/modules/check_ip.sh @@ -10,7 +10,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" info_game.sh -ip_commands_array=("/bin/ip" "/usr/sbin/ip" "ip") +ip_commands_array=("ip" "/bin/ip" "/usr/sbin/ip") for ip_command in "${ip_commands_array[@]}"; do if [ "$(command -v "${ip_command}" 2> /dev/null)" ]; then ipcommand="${ip_command}" @@ -18,7 +18,7 @@ for ip_command in "${ip_commands_array[@]}"; do fi done -ethtool_commands_array=("/bin/ethtool" "/usr/sbin/ethtool" "ethtool") +ethtool_commands_array=("ethtool" "/bin/ethtool" "/usr/sbin/ethtool") for ethtool_command in "${ethtool_commands_array[@]}"; do if [ "$(command -v "${ethtool_command}" 2> /dev/null)" ]; then ethtoolcommand="${ethtool_command}" @@ -34,21 +34,21 @@ function fn_is_valid_ip() { grep -qEe '^[1-9]+[0-9]*\.[0-9]+\.[0-9]+\.[0-9]+$' <<< "${ip}" } -# Check if server has multiple IP addresses +# Check if server has multiple IP addresses. # If the IP variable has been set by user. if fn_is_valid_ip "${ip}"; then queryips=("${ip}") httpip=("${ip}") telnetip=("${ip}") -# If game config does have an IP set. +# If the game config has an IP set. elif fn_is_valid_ip "${configip}"; then queryips=("${configip}") ip="${configip}" httpip=("${configip}") telnetip=("${configip}") # If there is only 1 server IP address. -# Some IP details can automaticly use the one IP +# Some IP details can automatically use the one IP. elif [ "${#current_ips[@]}" == "1" ]; then queryips=("127.0.0.1" "${current_ips[@]}") ip="0.0.0.0" diff --git a/lgsm/modules/command_dev_query_raw.sh b/lgsm/modules/command_dev_query_raw.sh index d75d12f31..f52c09a4b 100644 --- a/lgsm/modules/command_dev_query_raw.sh +++ b/lgsm/modules/command_dev_query_raw.sh @@ -77,7 +77,7 @@ echo -e "==================================================================" fi if [ -v httpqueryport ]; then - echo -e "HTTP Query: \t${httpqueryport} \t$(ss -tupl | grep -c "${httpqueryport}") \t$(ss -tupl | grep" ${httpqueryport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${httpqueryport} | grep udp | awk '{ print $2 }')" + echo -e "HTTP Query: \t${httpqueryport} \t$(ss -tupl | grep -c "${httpqueryport}") \t$(ss -tupl | grep" ${httpqueryport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${httpqueryport}" | grep udp | awk '{ print $2 }')" else echo -e "HTTP Query:" fi