Commit 2f2bcf87 authored by Dylan Araps's avatar Dylan Araps Committed by GitHub

Merge pull request #442 from iandrewt/publicip

Fix connection timed out with public_ip (dig)
parents 96592d0c cc641708
...@@ -1700,6 +1700,7 @@ get_local_ip() { ...@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment