From 7241869985436578e46a614b5f23d19e172058f6 Mon Sep 17 00:00:00 2001 From: Julien Malik Date: Tue, 8 Mar 2016 16:57:22 +0100 Subject: [PATCH] [fix] use ipX.yunohost.org service to retrieve public IP --- data/hooks/conf_regen/43-dnsmasq | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/data/hooks/conf_regen/43-dnsmasq b/data/hooks/conf_regen/43-dnsmasq index 27aecb5dd..7fb458746 100644 --- a/data/hooks/conf_regen/43-dnsmasq +++ b/data/hooks/conf_regen/43-dnsmasq @@ -15,12 +15,11 @@ function safe_copy () { cd /usr/share/yunohost/templates/dnsmasq -# Get IP address -ip=$(curl https://ip.yunohost.org 2>/dev/null || echo '0.0.0.0') +# Get IPv4 address +ip=$(curl -4 https://ip.yunohost.org 2>/dev/null || echo '0.0.0.0') # Get IPv6 IP address -ipv6=$(ip route get 2000:: | grep -q "unreachable" && echo '' \ - || ip route get 2000:: | grep -v ' fe80:' | grep -v 'cache' | awk '{print $9}') +ipv6=$(curl -6 http://ipv6.yunohost.org 2>/dev/null) sudo mkdir -p /etc/dnsmasq.d