一个统计当前网段活动IP数量的脚本

来源:互联网 发布:三观尽毁的淘宝买家秀 编辑:程序博客网 时间:2024/06/01 09:38
#!/bin/bash#This script will count up the number of active IP in the current network segment!declare -i num=0for i in {1..254}do        ping -c2 192.168.0.$i &> /dev/null        if [ $? = 0 ];then                num=$num+1        fidoneecho "The number of up host in 192.168.0.0/24 is $num"


这个脚本虽然可以运行,但是速度特别慢。。。

0 0
原创粉丝点击