检查网段剩余IP

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

#!/bin/bash
read -p "Please keyin the network segment: (e.g. 10.88.1) " farm

for i in `seq 2 255`
  do
    ip="$farm.$i"

    ping -c 3 $ip &> /dev/null
    if [ $? -eq 0 ];then
      echo "$ip is on line"
    else
      echo "$ip is not on line"
    fi
 done