0
点赞
收藏
分享

微信扫一扫

批量检测IP连通性脚本

yellowone 2023-10-17 阅读 38
bash运维

#!/bin/bash
myping(){
ping -c1 -w1 $1 &>/dev/null
num=$?

if [ $num -eq 0 ]
then
    echo "$1 is up."
else
    echo "$1 is down."
fi
}

for i in {1..25}
do
    myping 192.168.254.$i
done

举报

相关推荐

0 条评论