Commit d396c14f authored by Dylan Araps's avatar Dylan Araps

Local IP: Fix IP address on Minix

parent 446926dd
......@@ -1652,11 +1652,15 @@ get_battery() {
get_local_ip() {
case "$os" in
"Linux" | "BSD" | "Solaris" | "MINIX")
"Linux" | "BSD" | "Solaris")
local_ip="$(ip route get 1 | awk '{print $NF;exit}')"
[[ -z "$local_ip" ]] && local_ip="$(ifconfig | awk '/broadcast/ {print $2}')"
;;
"MINIX")
local_ip="$(ifconfig | awk '{printf $3; exit}')"
;;
"Mac OS X" | "iPhone OS")
local_ip="$(ipconfig getifaddr en0)"
[[ -z "$local_ip" ]] && local_ip="$(ipconfig getifaddr en1)"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment