测试网络ping通脚本

#!/bin/bash
function ping_success(){
	if ping -c 1 $ip >/dev/null; then
		echo "$ip ping is success." >> success.txt
		continue
	fi
}
cat ip.txt | while read ip
do
	ping_success
	echo "$ip ping is failure">>fail.txt

done

猜你喜欢

转载自blog.csdn.net/qq_33202508/article/details/83655211