mirror of
https://github.com/dylanaraps/neofetch.git
synced 2025-12-24 12:32:32 +00:00
Add experimental and untested BSD support to localip
This commit is contained in:
5
fetch
5
fetch
@@ -1355,6 +1355,11 @@ getlocalip () {
|
||||
[ -z "$localip" ] && localip="$(ipconfig getifaddr en1)"
|
||||
;;
|
||||
|
||||
*"BSD")
|
||||
localip="$(ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' \
|
||||
| grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1')"
|
||||
;;
|
||||
|
||||
"Windows")
|
||||
localip="$(ipconfig | awk -F ': ' '/IPv4 Address/ {printf $2}')"
|
||||
;;
|
||||
|
||||
Reference in New Issue
Block a user