fix: Added IPv6 support with brackets to trusted domains

Signed-off-by: Lukasz Goworko <lukaszgoworko@users.noreply.github.com>
This commit is contained in:
Lukasz Goworko 2025-10-16 10:17:21 +02:00 committed by Tobias Knöppler
parent 5f38f64336
commit cc5c73abf4

View File

@ -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