Added local IP support to OS X
This commit is contained in:
parent
3e9975c438
commit
2f13ce79de
1 changed files with 5 additions and 0 deletions
5
fetch
5
fetch
|
@ -1343,6 +1343,11 @@ getlocalip () {
|
|||
localip="$(ip route get 1 | awk '{print $NF;exit}')"
|
||||
;;
|
||||
|
||||
"Mac OS X")
|
||||
localip="$(ipconfig getifaddr en0)"
|
||||
[ -z "$localip" ] && localip="$(ipconfig getifaddr en1)"
|
||||
;;
|
||||
|
||||
"Windows")
|
||||
localip="$(ipconfig | awk -F ': ' '/IPv4 Address/ {printf $2}')"
|
||||
;;
|
||||
|
|
Loading…
Reference in a new issue