fix conn time-out with dig
This commit is contained in:
parent
96592d0ccd
commit
cc641708aa
1 changed files with 1 additions and 0 deletions
1
neofetch
1
neofetch
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue