标签:ping
#!/bin/bash # net=‘192.168.141‘ uphost=0 downhost=0 for i in `seq 1 254`;do ping -c 1 -w 1 $net.$i &> /dev/null if [ $? -eq 0 ];then echo "$net.$i is up" let uphost++ else echo "$net.$i is down." let downhost++ fi done echo "up is $uphost" echo "down is $downhost"
标签:ping
原文地址:http://limingyu.blog.51cto.com/12564998/1948288