diff --git a/choose-cn.sh b/choose-cn.sh index 565d7e2..ecfebc9 100644 --- a/choose-cn.sh +++ b/choose-cn.sh @@ -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 \ No newline at end of file +done < ip_use.txt