diff --git a/dynmotd b/dynmotd index 84e7aa8..bc0a110 100755 --- a/dynmotd +++ b/dynmotd @@ -54,9 +54,9 @@ service_info() { for PORT in ${PORT_LIST}; do MSG="${MSG}${MAGENTA}+ " # If a port listen - if (netstat -lnt|grep -m1 ${PORT} > /dev/null); then + if (ss -lutn|grep -m1 ":${PORT}" > /dev/null); then # Example: "tcp/127.0.0.1:25" - MSG="${MSG}${GREEN}$(netstat -lnt|grep -m1 ${PORT}|awk '{print $1"/"$4}')${RESET} " + MSG="${MSG}${GREEN}$(ss -lutn|grep -m1 ":${PORT}"|awk '{print $1"/"$5}')${RESET} " else # Example: "22: NOT LISTENING" MSG="${MSG}${REDB}${PORT}: NOT LISTENING${RESET} "