centos下批量ping检测IP是不是通的

xiaoxiao2021-02-27  202

将IP列表存到allip文件里

将以下代码另存为check.sh,输入命令

bash check.sh

ping不通的IP会自动保存到logfile文件里

#! /bin/bash for i in `cat allip` do ping -c 1 $i|grep -q 'ttl=' && echo "$i ok" || echo "$i">>logfile done exit()
转载请注明原文地址: https://www.6miu.com/read-12820.html

最新回复(0)