fix conn time-out with dig

This commit is contained in:
Andrew Titmuss 2016-11-17 14:49:55 +11:00
parent 96592d0ccd
commit cc641708aa
No known key found for this signature in database
GPG key ID: 8AF42975C787E0B2

View file

@ -1700,6 +1700,7 @@ get_local_ip() {
get_public_ip() { get_public_ip() {
if type -p dig >/dev/null; then if type -p dig >/dev/null; then
public_ip="$(dig +time=1 +tries=1 +short myip.opendns.com @resolver1.opendns.com)" public_ip="$(dig +time=1 +tries=1 +short myip.opendns.com @resolver1.opendns.com)"
[[ "$public_ip" =~ ^\; ]] && unset public_ip
fi fi
if [[ -z "$public_ip" ]] && type -p curl >/dev/null; then if [[ -z "$public_ip" ]] && type -p curl >/dev/null; then