fix IP check

in some cases resolv.conf doesn't resolv correctly when using dig.
This commit is contained in:
Daniel Hansson 2021-11-13 18:38:54 +01:00 committed by GitHub
parent f1e778c0f1
commit 131df12fe5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

2
lib.sh
View File

@ -41,7 +41,7 @@ IFACE=$(ip r | grep "default via" | awk '{print $5}')
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)
WANIP4=$(curl -s -k -m 5 -4 https://api64.ipify.org)
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