diff --git a/sources/ss.c b/sources/ss.c index 1cff8ed..c3419bc 100644 --- a/sources/ss.c +++ b/sources/ss.c @@ -9,7 +9,7 @@ char ip[16]; void refreshConnections() { ssOutput = - popen("ss -atun4 | grep ESTAB | awk '{print $6}' | cut -f1 -d\":\"", "r"); + popen("ss -atun4 | awk '$2==\"ESTAB\" {split($6,a,\":\"); print a[1]}'", "r"); if (ssOutput == NULL) { printf("Failed to run ss command\n");