blockcheck: fix broken ip block tests

This commit is contained in:
bol-van
2025-11-15 00:22:44 +03:00
parent 105ac57655
commit ce7d91a7ca

View File

@@ -648,16 +648,15 @@ hdrfile_location()
curl_with_subst_ip() curl_with_subst_ip()
{ {
# $1 - domain # $1 - domain
# $2 - uri # $2 - port
# $3 - port # $3 - ip
# $4 - ip # $4+ - curl params
# $5+ - curl params local ip="$3"
local ip="$4"
case "$ip" in case "$ip" in
*:*) ip="[$ip]" ;; *:*) ip="[$ip]" ;;
esac esac
local connect_to="--connect-to $1::$ip${3:+:$3}" arg local connect_to="--connect-to $1::$ip${2:+:$2}" arg
shift ; shift ; shift; shift shift ; shift ; shift;
[ "$CURL_VERBOSE" = 1 ] && arg="-v" [ "$CURL_VERBOSE" = 1 ] && arg="-v"
[ "$CURL_CMD" = 1 ] && echo $CURL ${arg:+$arg }$connect_to "$@" [ "$CURL_CMD" = 1 ] && echo $CURL ${arg:+$arg }$connect_to "$@"
ALL_PROXY="$ALL_PROXY" "$CURL" ${arg:+$arg }$connect_to "$@" ALL_PROXY="$ALL_PROXY" "$CURL" ${arg:+$arg }$connect_to "$@"
@@ -675,7 +674,7 @@ curl_with_dig()
ip=$(mdig_resolve $1 $sdom) ip=$(mdig_resolve $1 $sdom)
shift ; shift ; shift shift ; shift ; shift
if [ -n "$ip" ]; then if [ -n "$ip" ]; then
curl_with_subst_ip "$sdom" "$suri" $port $ip "$@" curl_with_subst_ip "$sdom" "$port" "$ip" "$@"
else else
return 6 return 6
fi fi