Retrieve public IP info via drill
This commit is contained in:
parent
99f6ccd375
commit
85c6a5dd16
1 changed files with 5 additions and 0 deletions
5
neofetch
5
neofetch
|
@ -3371,6 +3371,11 @@ get_public_ip() {
|
|||
[[ "$public_ip" =~ ^\; ]] && unset public_ip
|
||||
fi
|
||||
|
||||
if [[ -z "$public_ip" ]] && type -p drill >/dev/null; then
|
||||
public_ip="$(drill myip.opendns.com @resolver1.opendns.com | \
|
||||
awk '/^myip\./ && $3 == "IN" {print $5}')"
|
||||
fi
|
||||
|
||||
if [[ -z "$public_ip" ]] && type -p curl >/dev/null; then
|
||||
public_ip="$(curl --max-time "$public_ip_timeout" -w '\n' "$public_ip_host")"
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue