From d2716eda7582f3b6a39b44565f571bdb7d286394 Mon Sep 17 00:00:00 2001 From: Joe Carstairs Date: Mon, 29 Jun 2026 11:18:34 +0100 Subject: [PATCH] uses dig myip.opendns.com instead of curl icanhazip.com for ipv4 --- get_ip_addr.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/get_ip_addr.sh b/get_ip_addr.sh index 057fcd0..f7f8ea2 100755 --- a/get_ip_addr.sh +++ b/get_ip_addr.sh @@ -7,8 +7,9 @@ if [ -z "${ip_version:-}" ] || ([ "$ip_version" != 4 ] && [ "$ip_version" != 6 ] fi if [ $ip_version = 4 ]; then - curl -4 http://icanhazip.com 2> /dev/null - exit 0 + dig +short myip.opendns.com @resolver1.opendns.com \ + && exit 0 \ + || exit 1 fi set -eu