shell/测试该网站存活的ip有哪些.txt

15 lines
229 B
Plaintext
Raw Permalink Normal View History

2024-05-30 20:44:37 +08:00
#!/usr/bin/bash
#
#by fuxiaoshun 4/2
ip=1.92.66
for i in {1..10}
do
ping -c1 $ip &>/dev/null
if [ $? -eq 0 ];then
echo "$ip.$i通" >>/tmp/up.txt
else
echo "$ip.$i不通" >>/tmp/down.txt
fi
done