From cc5c73abf4acf552c6f4e106874ad9e41f144c35 Mon Sep 17 00:00:00 2001 From: Lukasz Goworko Date: Thu, 16 Oct 2025 10:17:21 +0200 Subject: [PATCH] fix: Added IPv6 support with brackets to trusted domains Signed-off-by: Lukasz Goworko --- bin/nextcloud-domain.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bin/nextcloud-domain.sh b/bin/nextcloud-domain.sh index a8d0af1d..ffc9d86f 100644 --- a/bin/nextcloud-domain.sh +++ b/bin/nextcloud-domain.sh @@ -11,9 +11,12 @@ done # wicd service finishes before completing DHCP while :; do local_ip="$(get_ip)" - pub_ip="$(curl -m4 icanhazip.com 2>/dev/null)" - [[ "$pub_ip" != "" ]] && ncc config:system:set trusted_domains 11 --value="$pub_ip" + pub_ipv4="$(curl -4 -m4 icanhazip.com 2>/dev/null)" + pub_ipv6="$(curl -6 -m4 icanhazip.com 2>/dev/null)" + [[ "$pub_ipv4" != "" ]] && ncc config:system:set trusted_domains 11 --value="$pub_ipv4" + [[ "$pub_ipv6" != "" ]] && ncc config:system:set trusted_domains 12 --value="[$pub_ipv6]" + [[ "$local_ip" != "" ]] && break sleep 3