I looked on the net for this and couldn't find anything suitable. This is perfect if you have something like conky and want to see just a list of your established internet connections without all the fluff in between:
Code:
#!/bin/bash
##############################################################################
# A simple bash script to quickly show established connections
x="0"
for i in `netstat -n | grep "ESTABLISHED"`; do
x=$((x + 1))
if [ $x == 5 ]; then
if [[ $i != *'127.0'* ]] && [[ $i != *'192.168'* ]]; then
echo "$i"
fi
elif [ $x == 6 ]; then
x="0"
fi
done
The output will look something like this:
Code:
72.127.xxx.xxx
42.78.xxx.xxx
98.54.xxx.xxx
...etc, etc
Enjoy
Bookmarks