专注 K8S研究
分类:
2010-10-16 10:45:40
chinaboywg2010-10-16 10:45:53
#!/bin/bash
File=./ip
while read line
do
ip=`echo $line | awk '{print $1}'`
web=`echo $line | awk '{print $2}'`
ip2=`ping $web -c 1 -n | sed -n '2p' | awk -F: '{print $1}' | awk '{p
rint $4}'`
if [ "$ip" != "$ip2" ]
then
echo $ip2 $web >> difip
fi
done<$File