Skip to content

Commit cc721aa

Browse files
committed
add new details to queryraw
1 parent 0ca6c8a commit cc721aa

File tree

1 file changed

+56
-8
lines changed

1 file changed

+56
-8
lines changed

lgsm/functions/command_dev_query_raw.sh

Lines changed: 56 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,59 @@ info_config.sh
1515
info_parms.sh
1616

1717
echo -e ""
18-
echo -e "Query Port - Raw Output"
18+
echo -e "${lightgreen}Query IP Addresses${default}"
1919
echo -e "=================================================================="
2020
echo -e ""
21-
echo -e "QUERY IP"
2221
for queryip in "${queryips[@]}"; do
2322
echo -e "${queryip}"
2423
done
24+
echo -e ""
25+
echo -e "${lightgreen}Game Server Ports${default}"
26+
echo -e "=================================================================="
27+
{
28+
echo -e "${lightblue}Port Name\tPort Number\tStatus\tTCP\tUDP${default}"
29+
if [ -v port ]; then
30+
echo -e "Game:\t${port}\t$(ss -tupl|grep ${port}|wc -l)\t$(ss -tupl|grep ${port}|grep tcp|awk '{ print $2 }')\t$(ss -tupl|grep ${port}|grep udp|awk '{ print $2 }')"
31+
else
32+
echo -e "Game:\tN/A"
33+
fi
34+
35+
if [ -v queryport ]; then
36+
echo -e "Query:\t${queryport}\t$(ss -tupl|grep ${queryport}|wc -l)\t$(ss -tupl|grep ${queryport}|grep tcp|awk '{ print $2 }')\t$(ss -tupl|grep ${queryport}|grep udp|awk '{ print $2 }')"
37+
else
38+
echo -e "Query:\tN/A"
39+
fi
40+
41+
if [ -v clientport ]; then
42+
echo -e "Client:\t${clientport}\t$(ss -tupl|grep ${clientport}|wc -l)\t$(ss -tupl|grep ${clientport}|grep tcp|awk '{ print $2 }')\t$(ss -tupl|grep ${clientport}|grep udp|awk '{ print $2 }')"
43+
else
44+
echo -e "Client:\tN/A"
45+
fi
46+
47+
if [ -v rconport ]; then
48+
echo -e "RCON:\t${rconport}\t$(ss -tupl|grep ${rconport}|wc -l)\t$(ss -tupl|grep ${rconport}|grep tcp|awk '{ print $2 }')\t$(ss -tupl|grep ${rconport}|grep udp|awk '{ print $2 }')"
49+
else
50+
echo -e "RCON:\tN/A"
51+
fi
52+
53+
if [ -v httpport ]; then
54+
echo -e "HTTP:\t${httpport}\t$(ss -tupl|grep ${httpport}|wc -l)\t$(ss -tupl|grep ${httpport}|grep tcp|awk '{ print $2 }')\t$(ss -tupl|grep ${httpport}|grep udp|awk '{ print $2 }')"
55+
else
56+
echo -e "HTTP:\tN/A"
57+
fi
58+
} | column -s $'\t' -t
59+
echo -e ""
60+
echo -e "${lightgreen}Query Port - Raw Output${default}"
61+
echo -e "=================================================================="
62+
2563
echo -e "================================="
26-
echo -e "Ports"
64+
echo -e "${lightgreen}Ports${default}"
2765
echo -e "================================="
2866
echo -e ""
2967
echo -e "PORT: ${port}"
3068
echo -e "QUERY PORT: ${queryport}"
3169
echo -e ""
32-
echo -e "Gamedig Raw Output"
70+
echo -e "${lightgreen}Gamedig Raw Output${default}"
3371
echo -e "================================="
3472
echo -e ""
3573
if [ ! "$(command -v gamedig 2>/dev/null)" ]; then
@@ -45,7 +83,7 @@ for queryip in "${queryips[@]}"; do
4583
echo "${gamedigraw}" | jq
4684
done
4785
echo -e ""
48-
echo -e "gsquery Raw Output"
86+
echo -e "${lightgreen}gsquery Raw Output${default}"
4987
echo -e "================================="
5088
echo -e ""
5189
for queryip in "${queryips[@]}"; do
@@ -57,7 +95,7 @@ for queryip in "${queryips[@]}"; do
5795
"${functionsdir}"/query_gsquery.py -a "${queryip}" -p "${queryport}" -e "${querytype}"
5896
done
5997
echo -e ""
60-
echo -e "TCP Raw Output"
98+
echo -e "${lightgreen}TCP Raw Output${default}"
6199
echo -e "================================="
62100
echo -e ""
63101
for queryip in "${queryips[@]}"; do
@@ -73,10 +111,10 @@ for queryip in "${queryips[@]}"; do
73111
fi
74112
done
75113
echo -e ""
76-
echo -e "Game Port - Raw Output"
114+
echo -e "${lightgreen}Game Port - Raw Output${default}"
77115
echo -e "=================================================================="
78116
echo -e ""
79-
echo -e "TCP Raw Output"
117+
echo -e "${lightgreen}TCP Raw Output${default}"
80118
echo -e "================================="
81119
echo -e ""
82120
for queryip in "${queryips[@]}"; do
@@ -91,5 +129,15 @@ for queryip in "${queryips[@]}"; do
91129
echo -e "TCP query FAIL"
92130
fi
93131
done
132+
echo -e ""
133+
echo -e "${lightgreen}Steam Master Server Response${default}"
134+
echo -e "=================================================================="
135+
echo -e ""
136+
137+
echo -e ""
138+
echo -e "${lightgreen}ss Details${default}"
139+
echo -e "=================================================================="
140+
echo -e ""
141+
94142
exitcode=0
95143
core_exit.sh

0 commit comments

Comments
 (0)