Local IP: Fix IP address on Minix
This commit is contained in:
parent
446926ddb4
commit
d396c14f2a
1 changed files with 5 additions and 1 deletions
6
neofetch
6
neofetch
|
@ -1652,11 +1652,15 @@ get_battery() {
|
||||||
|
|
||||||
get_local_ip() {
|
get_local_ip() {
|
||||||
case "$os" in
|
case "$os" in
|
||||||
"Linux" | "BSD" | "Solaris" | "MINIX")
|
"Linux" | "BSD" | "Solaris")
|
||||||
local_ip="$(ip route get 1 | awk '{print $NF;exit}')"
|
local_ip="$(ip route get 1 | awk '{print $NF;exit}')"
|
||||||
[[ -z "$local_ip" ]] && local_ip="$(ifconfig | awk '/broadcast/ {print $2}')"
|
[[ -z "$local_ip" ]] && local_ip="$(ifconfig | awk '/broadcast/ {print $2}')"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
"MINIX")
|
||||||
|
local_ip="$(ifconfig | awk '{printf $3; exit}')"
|
||||||
|
;;
|
||||||
|
|
||||||
"Mac OS X" | "iPhone OS")
|
"Mac OS X" | "iPhone OS")
|
||||||
local_ip="$(ipconfig getifaddr en0)"
|
local_ip="$(ipconfig getifaddr en0)"
|
||||||
[[ -z "$local_ip" ]] && local_ip="$(ipconfig getifaddr en1)"
|
[[ -z "$local_ip" ]] && local_ip="$(ipconfig getifaddr en1)"
|
||||||
|
|
Loading…
Reference in a new issue