Skip to content

Commit

Permalink
Merge branch 'master' of github-brianpcurran:brianpcurran/gandi-autom…
Browse files Browse the repository at this point in the history
…atic-dns into master
  • Loading branch information
Brian Curran committed Nov 19, 2020
2 parents 80d203f + 2c19a05 commit 5e910d1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion gad
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,11 @@ elif [ ! -z "$ext_if" ]; then
ext_ip=$(ifconfig "$ext_if" | sed -n "s/.*${inet} \(addr:\)* *${ip_regex}.*/\2/p" | head -1)
else
ext_ip_method="OpenDNS"
ext_ip=$(dig "$record_type" +short @resolver1.opendns.com myip.opendns.com)
if [ "$record_type" = "A" ]; then
ext_ip=$(dig -4 "$record_type" +short @resolver1.opendns.com myip.opendns.com)
else
ext_ip=$(dig "$record_type" +short @resolver1.opendns.com myip.opendns.com)
fi
fi
if [ -z "$ext_ip" ]; then
printf "Failed to determine external IP address with %s. See above error.\\n" "$ext_ip_method"
Expand Down

0 comments on commit 5e910d1

Please sign in to comment.