#!/bin/bash
#ping host down or up
for i in `cat /home/zhanghaodong/ping.txt`
do
ping -c 3 -w 2 -i 0.2 $i &>/dev/null
if [ $? -eq 0 ];then
echo "$i is up"
else
echo "$i is down"
fi
done
#!/bin/bash
#ping host down or up
for i in `cat /home/zhanghaodong/ping.txt`
do
ping -c 3 -w 2 -i 0.2 $i &>/dev/null
if [ $? -eq 0 ];then
echo "$i is up"
else
echo "$i is down"
fi
done
本文标题:ping主机up or down
本文链接:https://www.haomeiwen.com/subject/wxebtctx.html
网友评论