查看是否ping通网站
#!/bin/bash
#Checks to see if hosts 192.168.1.100-192.168.1.200 are alive
for n in {100..200}; do
host=192.168.1.$n
ping -c 2 $host >/dev/null
if [ $? = 0 ]; then
echo "$host is UP"
else
echo "$host is DOWN"
fi
done
读网站文本
#!/bin/bash
while read host
do
ping -c 2 $host >/dev/null
if [ $? = 0 ]
then
echo "$host"
else
echo "$hostN"
fi
done < domain.txt
1415

被折叠的 条评论
为什么被折叠?



