diff --git a/dynmotd b/dynmotd index bc0a110..666fdd7 100755 --- a/dynmotd +++ b/dynmotd @@ -56,7 +56,8 @@ service_info() { # If a port listen if (ss -lutn|grep -m1 ":${PORT}" > /dev/null); then # Example: "tcp/127.0.0.1:25" - MSG="${MSG}${GREEN}$(ss -lutn|grep -m1 ":${PORT}"|awk '{print $1"/"$5}')${RESET} " + #MSG="${MSG}${GREEN}$(ss -lutn|grep -m1 ":${PORT}"|awk '{print $1"/"$5}')${RESET} " + MSG="${MSG}${GREEN}$(ss -lutn|grep ${PORT}|sort|head -n1|awk '{print $1"/"$5}')${RESET} " else # Example: "22: NOT LISTENING" MSG="${MSG}${REDB}${PORT}: NOT LISTENING${RESET} "