Created
June 9, 2014 21:30
-
-
Save jakelogemann/af7bbc5ab7e1ee1b7139 to your computer and use it in GitHub Desktop.
Check Connections To Port
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Lists connections on a given port, defaults to 80 | |
PORT=${1:-80} | |
clear | |
while x=0; do | |
clear; | |
echo "Connections to $HOSTNAME:$PORT" | |
echo "[Updated: $(date)]"; | |
echo "=============================="; | |
echo ""; | |
netstat -np|grep :$PORT|grep -v LISTEN|awk '{print $5}'|cut -d: -f1|uniq -c; | |
sleep 5 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment