From 6c76070b387648944987143b6a57bbbb5b0e6927 Mon Sep 17 00:00:00 2001 From: Ing Date: Fri, 18 Apr 2025 03:04:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20curl=20=E5=91=BD=E4=BB=A4?= =?UTF-8?q?=EF=BC=8C=E5=A2=9E=E5=8A=A0=E8=BF=9E=E6=8E=A5=E8=B6=85=E6=97=B6?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- files/initrd/opt/rr/include/functions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/initrd/opt/rr/include/functions.sh b/files/initrd/opt/rr/include/functions.sh index 856921b3..583f3afd 100755 --- a/files/initrd/opt/rr/include/functions.sh +++ b/files/initrd/opt/rr/include/functions.sh @@ -224,7 +224,7 @@ function _get_fastest() { done else for I in "$@"; do - speed=$(curl -skL -w '%{time_total}' "${I}" -o /dev/null) + speed=$(curl -skL -m 10 --connect-timeout 10 -w '%{time_total}' "${I}" -o /dev/null) speed=$(awk "BEGIN {print (${speed:-0.999} * 1000)}") speedlist+="${I} ${speed:-999}\n" # Assign default value 999 if speed is empty done