Fixed problem with dig not always giving correct output

pull/34/head
9cco 3 years ago
parent e8873cc328
commit ff6a8df63c
  1. 3
      cloudflare-template.sh

@ -21,7 +21,8 @@ command -v dig &> /dev/null
# Use the DNS lookup if dig is available. # Use the DNS lookup if dig is available.
if [[ $? -eq 0 ]]; then if [[ $? -eq 0 ]]; then
ip=$(dig +short myip.opendns.com @resolver1.opendns.com); ip=$(dig +short myip.opendns.com @resolver1.opendns.com);
else fi
if [[ $ip -eq "" ]]; then
ip=$(curl -s https://api.ipify.org || curl -s https://ipv4.icanhazip.com/) ip=$(curl -s https://api.ipify.org || curl -s https://ipv4.icanhazip.com/)
fi fi

Loading…
Cancel
Save