From 459e3abed8b2d2562dd6ec59d084ca8de1e8eb9e Mon Sep 17 00:00:00 2001 From: Daniel Hansson Date: Thu, 11 Nov 2021 12:05:13 +0100 Subject: [PATCH] fix ipv4 check (#2129) Signed-off-by: enoch85 --- lib.sh | 4 ++-- network/ddclient-configuration.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib.sh b/lib.sh index e0c0d3f8..7fe9a703 100644 --- a/lib.sh +++ b/lib.sh @@ -42,7 +42,7 @@ IFACE2=$(ip -o link show | awk '{print $2,$9}' | grep 'UP' | cut -d ':' -f 1) REPO=$(grep "^deb " /etc/apt/sources.list | grep http | awk '{print $2}' | head -1) ADDRESS=$(hostname -I | cut -d ' ' -f 1) # WANIP4=$(dig +short myip.opendns.com @resolver1.opendns.com) # as an alternative -WANIP4=$(curl -s -k -m 5 https://ipv4bot.whatismyipaddress.com) +WANIP4=$(curl -s -k -m 5 -4 icanhazip.com) INTERFACES="/etc/netplan/nextcloud.yaml" GATEWAY=$(ip route | grep default | awk '{print $3}') # Internet DNS required when a check needs to be made to a server outside the home/SME @@ -783,7 +783,7 @@ local tls_alpn_01="certbot certonly --preferred-challenges tls-alpn-01 $default local dns="certbot certonly --manual --manual-public-ip-logging-ok --preferred-challenges dns $default_le" local methods=(standalone dns) -for f in ${methods[*]} +for f in "${methods[*]}" do print_text_in_color "${ICyan}" "Trying to generate certs and validate them with $f method." current_method="" diff --git a/network/ddclient-configuration.sh b/network/ddclient-configuration.sh index 4c38ee4f..5b8c1e20 100644 --- a/network/ddclient-configuration.sh +++ b/network/ddclient-configuration.sh @@ -171,7 +171,7 @@ cat << DDCLIENT_CONF > "/etc/ddclient.conf" # Default system settings use=if, if=$IFACE -use=web, web=https://ipv4bot.whatismyipaddress.com +use=web, web=$WANIP4 # DDNS-service specific setting # Provider=$PROVIDER