Skip to content

Commit

Permalink
[PR] dylanaraps/neofetch#2074 from bgkillas - very useless code cleanup
Browse files Browse the repository at this point in the history
Upstream PR: dylanaraps/neofetch#2074
Thanks to @bgkillas

Co-authored-by: bgkillas <[email protected]>
  • Loading branch information
hykilpikonna and bgkillas committed Jul 31, 2022
2 parents 3ff1e38 + e4fecc6 commit 6086ea7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions neofetch
Original file line number Diff line number Diff line change
Expand Up @@ -2799,7 +2799,7 @@ get_memory() {
pages_wired="$(vm_stat | awk '/ wired/ { print $4 }')"
pages_compressed="$(vm_stat | awk '/ occupied/ { printf $5 }')"
pages_compressed="${pages_compressed:-0}"
mem_used="$(((${pages_app} + ${pages_wired//.} + ${pages_compressed//.}) * hw_pagesize / 1024 / 1024))"
mem_used="$(((pages_app + ${pages_wired//.} + ${pages_compressed//.}) * hw_pagesize / 1024 / 1024))"
fi
;;

Expand Down Expand Up @@ -4006,12 +4006,12 @@ get_local_ip() {
}

get_public_ip() {
if [[ ! -n "$public_ip_host" ]] && type -p dig >/dev/null; then
if [[ -z "$public_ip_host" ]] && type -p dig >/dev/null; then
public_ip="$(dig +time=1 +tries=1 +short myip.opendns.com @resolver1.opendns.com)"
[[ "$public_ip" =~ ^\; ]] && unset public_ip
fi

if [[ ! -n "$public_ip_host" ]] && [[ -z "$public_ip" ]] && type -p drill >/dev/null; then
if [[ -z "$public_ip_host" ]] && [[ -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
Expand Down

0 comments on commit 6086ea7

Please sign in to comment.