From 5b9466cfec1798ed55ba30f708c7ad7acb536a1c Mon Sep 17 00:00:00 2001 From: Andrew Titmuss Date: Sat, 19 Mar 2016 13:38:48 +1100 Subject: [PATCH] made publicip function faster by using dig --- neofetch | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/neofetch b/neofetch index cfaea51b..c5149205 100755 --- a/neofetch +++ b/neofetch @@ -1659,7 +1659,10 @@ getlocalip () { } getpublicip () { - if type -p curl >/dev/null 2>&1; then + if type -p dig >/dev/null 2>&1; then + publicip="$(dig +short myip.opendns.com @resolver1.opendns.com)" + + elif type -p curl >/dev/null 2>&1; then publicip="$(curl -w '\n' "$public_ip_host")" elif type -p wget >/dev/null 2>&1; then