core: 修复测试 url 403 时没有及时中断脚本

This commit is contained in:
bin456789 2025-01-01 17:38:30 +08:00
parent ea4af1f18d
commit 0abcd9ea30
No known key found for this signature in database
GPG Key ID: EE301B386DE6C11B

View File

@ -286,9 +286,23 @@ test_url_real() {
ret=$?
msg="$url not accessible"
case $ret in
22) failed "$msg" ;; # 403 404
23) break ;; # 限制了空间
*) [ $i -eq 0 ] && failed "$msg" ;; # 其他错误
22)
# 403 404
# 这里的 failed 虽然返回 1但是不会中断脚本因此要手动 return
failed "$msg"
return "$ret"
;;
23)
# 限制了空间
break
;;
*)
# 其他错误
if [ $i -eq 0 ]; then
failed "$msg"
return "$ret"
fi
;;
esac
sleep 1
fi