From 85c6a5dd16ac54b350255acdbf3b3122b2bd358a Mon Sep 17 00:00:00 2001 From: Vlad Glagolev Date: Tue, 14 May 2019 06:33:24 +0000 Subject: [PATCH] Retrieve public IP info via drill --- neofetch | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/neofetch b/neofetch index 2064d9d0..3bd821fe 100755 --- a/neofetch +++ b/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