Added local IP support to OS X

This commit is contained in:
Dylan 2016-02-09 10:48:37 +11:00
parent 3e9975c438
commit 2f13ce79de

5
fetch
View file

@ -1343,6 +1343,11 @@ getlocalip () {
localip="$(ip route get 1 | awk '{print $NF;exit}')" localip="$(ip route get 1 | awk '{print $NF;exit}')"
;; ;;
"Mac OS X")
localip="$(ipconfig getifaddr en0)"
[ -z "$localip" ] && localip="$(ipconfig getifaddr en1)"
;;
"Windows") "Windows")
localip="$(ipconfig | awk -F ': ' '/IPv4 Address/ {printf $2}')" localip="$(ipconfig | awk -F ': ' '/IPv4 Address/ {printf $2}')"
;; ;;