mirror of
https://github.com/bol-van/zapret.git
synced 2025-12-06 11:36:46 +03:00
blockcheck: fix broken ip block tests
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user