mirror of
https://github.com/dylanaraps/neofetch.git
synced 2025-12-23 03:59:58 +00:00
Merge pull request #163 from iandrewt/public_ip_opendns
Made publicip function faster by using dig
This commit is contained in:
5
neofetch
5
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
|
||||
|
||||
Reference in New Issue
Block a user