From 643fc0c45601bfbf8967fd064c8d311e15558248 Mon Sep 17 00:00:00 2001 From: Andrew Danshin Date: Fri, 27 Jun 2025 21:07:32 +0300 Subject: [PATCH] Support curl compiled without IPv6 support. modified: blockcheck.sh --- blockcheck.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/blockcheck.sh b/blockcheck.sh index df46f2f5..63e48f4d 100755 --- a/blockcheck.sh +++ b/blockcheck.sh @@ -635,7 +635,11 @@ curl_with_subst_ip() # $2 - port # $3 - ip # $4+ - curl params - local connect_to="--connect-to $1::[$3]${2:+:$2}" arg + local ip="$3" + case "$ip" in + *:*) ip="[$ip]" ;; + esac + local connect_to="--connect-to $1::$ip${2:+:$2}" arg shift ; shift ; shift [ "$CURL_VERBOSE" = 1 ] && arg="-v" [ "$CURL_CMD" = 1 ] && echo $CURL ${arg:+$arg }$connect_to "$@"