Merge pull request #442 from iandrewt/publicip
Fix connection timed out with public_ip (dig)
This commit is contained in:
commit
2f2bcf87e9
1 changed files with 1 additions and 0 deletions
1
neofetch
1
neofetch
|
@ -1700,6 +1700,7 @@ get_local_ip() {
|
|||
get_public_ip() {
|
||||
if type -p dig >/dev/null; then
|
||||
public_ip="$(dig +time=1 +tries=1 +short myip.opendns.com @resolver1.opendns.com)"
|
||||
[[ "$public_ip" =~ ^\; ]] && unset public_ip
|
||||
fi
|
||||
|
||||
if [[ -z "$public_ip" ]] && type -p curl >/dev/null; then
|
||||
|
|
Loading…
Reference in a new issue