@@ -28,169 +28,169 @@ echo -e "=================================================================="
28
28
{
29
29
echo -e " ${lightblue} Port Name \tPort Number \tStatus \tTCP \tUDP${default} "
30
30
if [ -v port ]; then
31
- 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
+ echo -e " Game: \t${port} \t$( ss -tupl | grep -c ${port} ) \t$( ss -tupl | grep ${port} | grep tcp | awk ' { print $2 }' ) \t$( ss -tupl | grep ${port} | grep udp | awk ' { print $2 }' ) "
32
32
else
33
33
echo -e " Game:"
34
34
fi
35
35
if [ " ${shortname} " == " rw" ]; then
36
36
if [ -v port2 ]; then
37
- echo -e " Game+1: \t${port2} \t$( ss -tupl | grep ${port} | wc -l ) \t$( ss -tupl | grep ${port2} | grep tcp | awk ' { print $2 }' ) \t$( ss -tupl | grep ${port2} | grep udp | awk ' { print $2 }' ) "
37
+ echo -e " Game+1: \t${port2} \t$( ss -tupl | grep -c ${port} ) \t$( ss -tupl | grep ${port2} | grep tcp | awk ' { print $2 }' ) \t$( ss -tupl | grep ${port2} | grep udp | awk ' { print $2 }' ) "
38
38
else
39
39
echo -e " Game+1:"
40
40
fi
41
41
42
42
if [ -v port3 ]; then
43
- echo -e " Game+2: \t${port3} \t$( ss -tupl | grep ${port} | wc -l ) \t$( ss -tupl | grep ${port3} | grep tcp | awk ' { print $2 }' ) \t$( ss -tupl | grep ${port3} | grep udp | awk ' { print $2 }' ) "
43
+ echo -e " Game+2: \t${port3} \t$( ss -tupl | grep -c ${port} ) \t$( ss -tupl | grep ${port3} | grep tcp | awk ' { print $2 }' ) \t$( ss -tupl | grep ${port3} | grep udp | awk ' { print $2 }' ) "
44
44
else
45
45
echo -e " Game+2:"
46
46
fi
47
47
48
48
if [ -v port4 ]; then
49
- echo -e " Game+3: \t${port4} \t$( ss -tupl | grep ${port} | wc -l ) \t$( ss -tupl | grep ${port4} | grep tcp | awk ' { print $2 }' ) \t$( ss -tupl | grep ${port4} | grep udp | awk ' { print $2 }' ) "
49
+ echo -e " Game+3: \t${port4} \t$( ss -tupl | grep -c ${port} ) \t$( ss -tupl | grep ${port4} | grep tcp | awk ' { print $2 }' ) \t$( ss -tupl | grep ${port4} | grep udp | awk ' { print $2 }' ) "
50
50
else
51
51
echo -e " Game+3:"
52
52
fi
53
53
fi
54
54
55
55
if [ -v port401 ]; then
56
- echo -e " Game+400: \t${port401} \t$( ss -tupl | grep ${port401} | wc -l ) \t$( ss -tupl | grep ${port401} | grep tcp | awk ' { print $2 }' ) \t$( ss -tupl | grep ${port401} | grep udp | awk ' { print $2 }' ) "
56
+ echo -e " Game+400: \t${port401} \t$( ss -tupl | grep -c ${port401} ) \t$( ss -tupl | grep ${port401} | grep tcp | awk ' { print $2 }' ) \t$( ss -tupl | grep ${port401} | grep udp | awk ' { print $2 }' ) "
57
57
else
58
58
echo -e " Game+400:"
59
59
fi
60
60
61
61
if [ -v portipv6 ]; then
62
- echo -e " Game ipv6: \t${portipv6} \t$( ss -tupl | grep ${portipv6} | wc -l ) \t$( ss -tupl | grep ${portipv6} | grep tcp | awk ' { print $2 }' ) \t$( ss -tupl | grep ${portipv6} | grep udp | awk ' { print $2 }' ) "
62
+ echo -e " Game ipv6: \t${portipv6} \t$( ss -tupl | grep -c ${portipv6} ) \t$( ss -tupl | grep ${portipv6} | grep tcp | awk ' { print $2 }' ) \t$( ss -tupl | grep ${portipv6} | grep udp | awk ' { print $2 }' ) "
63
63
else
64
64
echo -e " Game ipv6:"
65
65
fi
66
66
67
67
if [ -v queryport ]; then
68
- 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 }' ) "
68
+ echo -e " Query: \t${queryport} \t$( ss -tupl | grep -c ${queryport} ) \t$( ss -tupl | grep ${queryport} | grep tcp | awk ' { print $2 }' ) \t$( ss -tupl | grep ${queryport} | grep udp | awk ' { print $2 }' ) "
69
69
else
70
70
echo -e " Query:"
71
71
fi
72
72
73
73
if [ -v httpport ]; then
74
- 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 }' ) "
74
+ echo -e " HTTP: \t${httpport} \t$( ss -tupl | grep -c ${httpport} ) \t$( ss -tupl | grep ${httpport} | grep tcp | awk ' { print $2 }' ) \t$( ss -tupl | grep ${httpport} | grep udp | awk ' { print $2 }' ) "
75
75
else
76
76
echo -e " HTTP:"
77
77
fi
78
78
79
79
if [ -v httpqueryport ]; then
80
- echo -e " HTTP Query: \t${httpqueryport} \t$( ss -tupl | grep ${httpqueryport} | wc -l ) \t$( ss -tupl | grep ${httpqueryport} | grep tcp | awk ' { print $2 }' ) \t$( ss -tupl | grep ${httpqueryport} | grep udp | awk ' { print $2 }' ) "
80
+ 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 }' ) "
81
81
else
82
82
echo -e " HTTP Query:"
83
83
fi
84
84
85
85
if [ -v webadminport ]; then
86
- echo -e " Web Admin: \t${webadminport} \t$( ss -tupl | grep ${webadminport} | wc -l ) \t$( ss -tupl | grep ${webadminport} | grep tcp | awk ' { print $2 }' ) \t$( ss -tupl | grep ${webadminport} | grep udp | awk ' { print $2 }' ) "
86
+ echo -e " Web Admin: \t${webadminport} \t$( ss -tupl | grep -c ${webadminport} ) \t$( ss -tupl | grep ${webadminport} | grep tcp | awk ' { print $2 }' ) \t$( ss -tupl | grep ${webadminport} | grep udp | awk ' { print $2 }' ) "
87
87
else
88
88
echo -e " Web Admin:"
89
89
fi
90
90
91
91
if [ -v clientport ]; then
92
- 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 }' ) "
92
+ echo -e " Client: \t${clientport} \t$( ss -tupl | grep -c ${clientport} ) \t$( ss -tupl | grep ${clientport} | grep tcp | awk ' { print $2 }' ) \t$( ss -tupl | grep ${clientport} | grep udp | awk ' { print $2 }' ) "
93
93
else
94
94
echo -e " Client:"
95
95
fi
96
96
97
97
if [ -v rconport ]; then
98
- 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 }' ) "
98
+ echo -e " RCON: \t${rconport} \t$( ss -tupl | grep -c ${rconport} ) \t$( ss -tupl | grep ${rconport} | grep tcp | awk ' { print $2 }' ) \t$( ss -tupl | grep ${rconport} | grep udp | awk ' { print $2 }' ) "
99
99
else
100
100
echo -e " RCON:"
101
101
fi
102
102
103
103
if [ -v rawport ]; then
104
- echo -e " RAW UDP Socket: \t${rawport} \t$( ss -tupl | grep ${rawport} | wc -l ) \t$( ss -tupl | grep ${rawport} | grep tcp | awk ' { print $2 }' ) \t$( ss -tupl | grep ${rawport} | grep udp | awk ' { print $2 }' ) "
104
+ echo -e " RAW UDP Socket: \t${rawport} \t$( ss -tupl | grep -c ${rawport} ) \t$( ss -tupl | grep ${rawport} | grep tcp | awk ' { print $2 }' ) \t$( ss -tupl | grep ${rawport} | grep udp | awk ' { print $2 }' ) "
105
105
else
106
106
echo -e " RAW UDP Socket:"
107
107
fi
108
108
109
109
if [ -v masterport ]; then
110
- echo -e " Game: Master: \t${masterport} \t$( ss -tupl | grep ${masterport} | wc -l ) \t$( ss -tupl | grep ${masterport} | grep tcp | awk ' { print $2 }' ) \t$( ss -tupl | grep ${masterport} | grep udp | awk ' { print $2 }' ) "
110
+ echo -e " Game: Master: \t${masterport} \t$( ss -tupl | grep -c ${masterport} ) \t$( ss -tupl | grep ${masterport} | grep tcp | awk ' { print $2 }' ) \t$( ss -tupl | grep ${masterport} | grep udp | awk ' { print $2 }' ) "
111
111
else
112
112
echo -e " Game: Master:"
113
113
fi
114
114
115
115
if [ -v steamport ]; then
116
- echo -e " Steam: \t${steamport} \t$( ss -tupl | grep ${steamport} | wc -l ) \t$( ss -tupl | grep ${steamport} | grep tcp | awk ' { print $2 }' ) \t$( ss -tupl | grep ${steamport} | grep udp | awk ' { print $2 }' ) "
116
+ echo -e " Steam: \t${steamport} \t$( ss -tupl | grep -c ${steamport} ) \t$( ss -tupl | grep ${steamport} | grep tcp | awk ' { print $2 }' ) \t$( ss -tupl | grep ${steamport} | grep udp | awk ' { print $2 }' ) "
117
117
else
118
118
echo -e " Steam:"
119
119
fi
120
120
121
121
if [ -v steamauthport ]; then
122
- echo -e " Steam: Auth: \t${steamauthport} \t$( ss -tupl | grep ${steamauthport} | wc -l ) \t$( ss -tupl | grep ${steamauthport} | grep tcp | awk ' { print $2 }' ) \t$( ss -tupl | grep ${steamauthport} | grep udp | awk ' { print $2 }' ) "
122
+ echo -e " Steam: Auth: \t${steamauthport} \t$( ss -tupl | grep -c ${steamauthport} ) \t$( ss -tupl | grep ${steamauthport} | grep tcp | awk ' { print $2 }' ) \t$( ss -tupl | grep ${steamauthport} | grep udp | awk ' { print $2 }' ) "
123
123
else
124
124
echo -e " Steam: Auth:"
125
125
fi
126
126
127
127
if [ -v steammasterport ]; then
128
- echo -e " Steam: Master: \t${steammasterport} \t$( ss -tupl | grep ${steammasterport} | wc -l ) \t$( ss -tupl | grep ${steammasterport} | grep tcp | awk ' { print $2 }' ) \t$( ss -tupl | grep ${steammasterport} | grep udp | awk ' { print $2 }' ) "
128
+ echo -e " Steam: Master: \t${steammasterport} \t$( ss -tupl | grep -c ${steammasterport} ) \t$( ss -tupl | grep ${steammasterport} | grep tcp | awk ' { print $2 }' ) \t$( ss -tupl | grep ${steammasterport} | grep udp | awk ' { print $2 }' ) "
129
129
else
130
130
echo -e " Steam: Master:"
131
131
fi
132
132
133
133
if [ -v steamqueryport ]; then
134
- echo -e " Steam: Query: \t${steamqueryport} \t$( ss -tupl | grep ${steamqueryport} | wc -l ) \t$( ss -tupl | grep ${steamqueryport} | grep tcp | awk ' { print $2 }' ) \t$( ss -tupl | grep ${steamqueryport} | grep udp | awk ' { print $2 }' ) "
134
+ echo -e " Steam: Query: \t${steamqueryport} \t$( ss -tupl | grep -c ${steamqueryport} ) \t$( ss -tupl | grep ${steamqueryport} | grep tcp | awk ' { print $2 }' ) \t$( ss -tupl | grep ${steamqueryport} | grep udp | awk ' { print $2 }' ) "
135
135
else
136
136
echo -e " Steam: Query:"
137
137
fi
138
138
if [ -v beaconport ]; then
139
- echo -e " Beacon: \t${beaconport} \t$( ss -tupl | grep ${beaconport} | wc -l ) \t$( ss -tupl | grep ${beaconport} | grep tcp | awk ' { print $2 }' ) \t$( ss -tupl | grep ${beaconport} | grep udp | awk ' { print $2 }' ) "
139
+ echo -e " Beacon: \t${beaconport} \t$( ss -tupl | grep -c ${beaconport} ) \t$( ss -tupl | grep ${beaconport} | grep tcp | awk ' { print $2 }' ) \t$( ss -tupl | grep ${beaconport} | grep udp | awk ' { print $2 }' ) "
140
140
else
141
141
echo -e " Beacon:"
142
142
fi
143
143
144
144
if [ -v appport ]; then
145
- echo -e " App: \t${appport} \t$( ss -tupl | grep ${appport} | wc -l ) \t$( ss -tupl | grep ${appport} | grep tcp | awk ' { print $2 }' ) \t$( ss -tupl | grep ${appport} | grep udp | awk ' { print $2 }' ) "
145
+ echo -e " App: \t${appport} \t$( ss -tupl | grep -c ${appport} ) \t$( ss -tupl | grep ${appport} | grep tcp | awk ' { print $2 }' ) \t$( ss -tupl | grep ${appport} | grep udp | awk ' { print $2 }' ) "
146
146
else
147
147
echo -e " App:"
148
148
fi
149
149
150
150
if [ -v telnetport ]; then
151
- echo -e " Telnet: \t${telnetport} \t$( ss -tupl | grep ${telnetport} | wc -l ) \t$( ss -tupl | grep ${telnetport} | grep tcp | awk ' { print $2 }' ) \t$( ss -tupl | grep ${telnetport} | grep udp | awk ' { print $2 }' ) "
151
+ echo -e " Telnet: \t${telnetport} \t$( ss -tupl | grep -c ${telnetport} ) \t$( ss -tupl | grep ${telnetport} | grep tcp | awk ' { print $2 }' ) \t$( ss -tupl | grep ${telnetport} | grep udp | awk ' { print $2 }' ) "
152
152
else
153
153
echo -e " Telnet:"
154
154
fi
155
155
156
156
if [ -v sourcetvport ]; then
157
- echo -e " SourceTV: \t${sourcetvport} \t$( ss -tupl | grep ${sourcetvport} | wc -l ) \t$( ss -tupl | grep ${sourcetvport} | grep tcp | awk ' { print $2 }' ) \t$( ss -tupl | grep ${sourcetvport} | grep udp | awk ' { print $2 }' ) "
157
+ echo -e " SourceTV: \t${sourcetvport} \t$( ss -tupl | grep -c ${sourcetvport} ) \t$( ss -tupl | grep ${sourcetvport} | grep tcp | awk ' { print $2 }' ) \t$( ss -tupl | grep ${sourcetvport} | grep udp | awk ' { print $2 }' ) "
158
158
else
159
159
echo -e " SourceTV:"
160
160
fi
161
161
162
162
if [ -v fileport ]; then
163
- echo -e " File: \t${fileport} \t$( ss -tupl | grep ${fileport} | wc -l ) \t$( ss -tupl | grep ${fileport} | grep tcp | awk ' { print $2 }' ) \t$( ss -tupl | grep ${fileport} | grep udp | awk ' { print $2 }' ) "
163
+ echo -e " File: \t${fileport} \t$( ss -tupl | grep -c ${fileport} ) \t$( ss -tupl | grep ${fileport} | grep tcp | awk ' { print $2 }' ) \t$( ss -tupl | grep ${fileport} | grep udp | awk ' { print $2 }' ) "
164
164
else
165
165
echo -e " File:"
166
166
fi
167
167
168
168
if [ -v udplinkport ]; then
169
- echo -e " UDP Link: \t${udplinkport} \t$( ss -tupl | grep ${udplinkport} | wc -l ) \t$( ss -tupl | grep ${udplinkport} | grep tcp | awk ' { print $2 }' ) \t$( ss -tupl | grep ${udplinkport} | grep udp | awk ' { print $2 }' ) "
169
+ echo -e " UDP Link: \t${udplinkport} \t$( ss -tupl | grep -c ${udplinkport} ) \t$( ss -tupl | grep ${udplinkport} | grep tcp | awk ' { print $2 }' ) \t$( ss -tupl | grep ${udplinkport} | grep udp | awk ' { print $2 }' ) "
170
170
else
171
171
echo -e " UDP Link:"
172
172
fi
173
173
174
174
if [ -v voiceport ]; then
175
- echo -e " Voice: \t${voiceport} \t$( ss -tupl | grep ${voiceport} | wc -l ) \t$( ss -tupl | grep ${voiceport} | grep tcp | awk ' { print $2 }' ) \t$( ss -tupl | grep ${voiceport} | grep udp | awk ' { print $2 }' ) "
175
+ echo -e " Voice: \t${voiceport} \t$( ss -tupl | grep -c ${voiceport} ) \t$( ss -tupl | grep ${voiceport} | grep tcp | awk ' { print $2 }' ) \t$( ss -tupl | grep ${voiceport} | grep udp | awk ' { print $2 }' ) "
176
176
else
177
177
echo -e " Voice:"
178
178
fi
179
179
180
180
if [ -v voiceunusedport ]; then
181
- echo -e " Voice (Unused): \t${voiceunusedport} \t$( ss -tupl | grep ${voiceunusedport} | wc -l ) \t$( ss -tupl | grep ${voiceunusedport} | grep tcp | awk ' { print $2 }' ) \t$( ss -tupl | grep ${voiceunusedport} | grep udp | awk ' { print $2 }' ) "
181
+ echo -e " Voice (Unused): \t${voiceunusedport} \t$( ss -tupl | grep -c ${voiceunusedport} ) \t$( ss -tupl | grep ${voiceunusedport} | grep tcp | awk ' { print $2 }' ) \t$( ss -tupl | grep ${voiceunusedport} | grep udp | awk ' { print $2 }' ) "
182
182
else
183
183
echo -e " Voice (Unused):"
184
184
fi
185
185
186
186
if [ -v battleeyeport ]; then
187
- echo -e " BattleEye: \t${battleeyeport} \t$( ss -tupl | grep ${battleeyeport} | wc -l ) \t$( ss -tupl | grep ${battleeyeport} | grep tcp | awk ' { print $2 }' ) \t$( ss -tupl | grep ${battleeyeport} | grep udp | awk ' { print $2 }' ) "
187
+ echo -e " BattleEye: \t${battleeyeport} \t$( ss -tupl | grep -c ${battleeyeport} ) \t$( ss -tupl | grep ${battleeyeport} | grep tcp | awk ' { print $2 }' ) \t$( ss -tupl | grep ${battleeyeport} | grep udp | awk ' { print $2 }' ) "
188
188
else
189
189
echo -e " BattleEye:"
190
190
fi
191
191
192
192
if [ -v statsport ]; then
193
- echo -e " Stats: \t${battleeyeport} \t$( ss -tupl | grep ${statsport} | wc -l ) \t$( ss -tupl | grep ${statsport} | grep tcp | awk ' { print $2 }' ) \t$( ss -tupl | grep ${statsport} | grep udp | awk ' { print $2 }' ) "
193
+ echo -e " Stats: \t${battleeyeport} \t$( ss -tupl | grep -c ${statsport} ) \t$( ss -tupl | grep ${statsport} | grep tcp | awk ' { print $2 }' ) \t$( ss -tupl | grep ${statsport} | grep udp | awk ' { print $2 }' ) "
194
194
else
195
195
echo -e " Stats:"
196
196
fi
@@ -210,10 +210,10 @@ echo -e ""
210
210
echo -e " ${lightgreen} Gamedig Raw Output${default} "
211
211
echo -e " ================================="
212
212
echo -e " "
213
- if [ ! " $( command -v gamedig 2> /dev/null) " ]; then
213
+ if [ ! " $( command -v gamedig 2> /dev/null) " ]; then
214
214
fn_print_failure_nl " gamedig not installed"
215
215
fi
216
- if [ ! " $( command -v jq 2> /dev/null) " ]; then
216
+ if [ ! " $( command -v jq 2> /dev/null) " ]; then
217
217
fn_print_failure_nl " jq not installed"
218
218
fi
219
219
for queryip in " ${queryips[@]} " ; do
0 commit comments