mirror of
https://github.com/PhyreApps/PhyrePanel.git
synced 2024-11-22 15:40:25 +00:00
14 lines
255 B
Bash
14 lines
255 B
Bash
netstat -aln | awk '
|
|
$6 == "LISTEN" {
|
|
if ($4 ~ "[.:][0-9]+$") {
|
|
split($4, a, /[:.]/);
|
|
port = a[length(a)];
|
|
p[port] = 1
|
|
}
|
|
}
|
|
END {
|
|
for (i = 3000; i < 65000 && p[i]; i++){};
|
|
if (i == 65000) {exit 1};
|
|
print i
|
|
}
|
|
'
|