From 2f13ce79de4db031bb92c37f0bb5f84d1ca51315 Mon Sep 17 00:00:00 2001 From: Dylan Date: Tue, 9 Feb 2016 10:48:37 +1100 Subject: [PATCH] Added local IP support to OS X --- fetch | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fetch b/fetch index d4ecc3a7..7ce5d776 100755 --- a/fetch +++ b/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}')" ;;