diff --git a/neofetch b/neofetch index c48ac298..b0ffd4e5 100755 --- a/neofetch +++ b/neofetch @@ -1638,8 +1638,9 @@ get_battery() { get_local_ip() { case "$os" in - "Linux") + "Linux" | "BSD" | "Solaris") local_ip="$(ip route get 1 | awk '{print $NF;exit}')" + [[ -z "$local_ip" ]] && local_ip="$(ifconfig | awk '/broadcast/ {print $2}')" ;; "Mac OS X" | "iPhone OS") @@ -1647,10 +1648,6 @@ get_local_ip() { [[ -z "$local_ip" ]] && local_ip="$(ipconfig getifaddr en1)" ;; - "BSD" | "Solaris") - local_ip="$(ifconfig | awk '/broadcast/ {print $2}')" - ;; - "Windows") local_ip="$(ipconfig | awk -F ': ' '/IPv4 Address/ {printf $2 ", "}')" local_ip="${local_ip%\,*}"