Deduplicate port 9850 in network connectivity display
Port 9850 was showing twice because it listens on both IPv4 (127.0.0.1) and IPv6 (::1). Added awk deduplication to show each port only once.
This commit is contained in:
@@ -157,8 +157,14 @@ echo ""
|
||||
# Check active ports
|
||||
echo -e "${BOLD}Network Connectivity:${NC}"
|
||||
|
||||
# Check for actual Acronis listening ports
|
||||
acronis_ports=$(netstat -tlnp 2>/dev/null | grep -E "(acronis|mms|aakore)" | awk '{print $4 " " $7}' | sort -u)
|
||||
# Check for actual Acronis listening ports (deduplicate IPv4/IPv6)
|
||||
acronis_ports=$(netstat -tlnp 2>/dev/null | grep -E "(acronis|mms|aakore)" | awk '{
|
||||
split($4, addr, ":");
|
||||
port = addr[length(addr)];
|
||||
if (!seen[port]++) {
|
||||
print $4 " " $7;
|
||||
}
|
||||
}')
|
||||
|
||||
if [ -n "$acronis_ports" ]; then
|
||||
echo "Active Acronis services:"
|
||||
|
||||
Reference in New Issue
Block a user