Created
November 9, 2012 08:49
-
-
Save mike-zhang/4044537 to your computer and use it in GitHub Desktop.
定时显示与特定主机的连接
This file contains hidden or 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 | |
r_host='10.11.1.100' | |
if [ -f '/usr/bin/watch' ] | |
then | |
watch -n 1 -d "netstat -an | grep $r_host" | |
else | |
while [ 1 ] | |
do | |
netstat -an | grep $r_host | |
sleep 1 | |
clear | |
done | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment