更新 choose-cn.sh

This commit is contained in:
chunzhi 2024-01-22 22:10:53 +08:00
parent 792cc6cac3
commit 2e241fbd2c

View File

@ -36,7 +36,7 @@ do
echo "Starting download test for $ip"
# 使用 curl 命令进行下载测试
start_time=$(date +%s.%N)
curl -s --resolve speed.cloudflare.com:443:"$ip" https://speed.cloudflare.com/__down?bytes=10000000 -o /dev/null --connect-timeout 5
curl -s --resolve speed.cloudflare.com:443:"$ip" https://speed.cloudflare.com/__down?bytes=10000000 -o /dev/null --connect-timeout 5 --max-time 10
curl_status=$?
end_time=$(date +%s.%N)
elapsed_time=$(echo "$end_time - $start_time" | bc)
@ -55,6 +55,8 @@ do
fi
else
echo "Download test for $ip failed with status $curl_status"
# 从 ip_use.txt 删除下载测试失败的 IP
sed -i "/$ip/d" ip_use.txt
fi
echo "Finished download test for $ip"
done < ip_use.txt
done < ip_use.txt