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:
cschantz
2025-11-06 16:54:17 -05:00
parent d557b3b0db
commit 5840f40594
+8 -2
View File
@@ -157,8 +157,14 @@ echo ""
# Check active ports # Check active ports
echo -e "${BOLD}Network Connectivity:${NC}" echo -e "${BOLD}Network Connectivity:${NC}"
# Check for actual Acronis listening ports # Check for actual Acronis listening ports (deduplicate IPv4/IPv6)
acronis_ports=$(netstat -tlnp 2>/dev/null | grep -E "(acronis|mms|aakore)" | awk '{print $4 " " $7}' | sort -u) 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 if [ -n "$acronis_ports" ]; then
echo "Active Acronis services:" echo "Active Acronis services:"