From a76a676bc46f68400348e64a549f01a79eac7292 Mon Sep 17 00:00:00 2001 From: Siraaj Khandkar Date: Wed, 5 Apr 2023 15:11:06 -0400 Subject: [PATCH] Note on how to work-around netstat output truncation --- home/lib/login_functions.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/home/lib/login_functions.sh b/home/lib/login_functions.sh index e51a2fa..cbd8236 100644 --- a/home/lib/login_functions.sh +++ b/home/lib/login_functions.sh @@ -826,6 +826,9 @@ status() { echo "${indent_unit}-->" + # TODO Populate pid->cmd dict from `ps -eo pid,comm` and lookup progs there + # since netstat -p output comes out truncated. + sudo -n netstat -tulnp \ | awk -v indent="${indent_unit}${indent_unit}" ' NR > 2 && ((/^tcp/ && proc = $7) || (/^udp/ && proc = $6)) { -- 2.20.1