From 936d3fb7391251227aa7a6b13f75ff40b9c7a4a6 Mon Sep 17 00:00:00 2001 From: Siraaj Khandkar Date: Fri, 30 Oct 2020 23:02:05 -0400 Subject: [PATCH] Sort and de-dup motd servers --- home/lib/login_functions.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/home/lib/login_functions.sh b/home/lib/login_functions.sh index f1b3313..df255d7 100644 --- a/home/lib/login_functions.sh +++ b/home/lib/login_functions.sh @@ -522,7 +522,9 @@ motd() { # WARN: ensure: $USER ALL=(ALL) NOPASSWD:/bin/netstat sudo netstat -tlnp \ | awk 'NR > 2 {print $7}' \ - | awk -F/ '{printf "%s%s", sep, $2; sep = " "} END {printf "\n"}' \ + | awk -F/ '{print $2}' \ + | sort -u \ + | xargs \ | column -t \ | indent "${indent_unit}${indent_unit}" } -- 2.20.1