Project

General

Profile

« Previous | Next » 

Revision 1677

Added local_ip to get local IP address

View differences:

bin/local_ip
1
#!/bin/sh
2
# Gets the local IP address
3
# Usage: self
4

  
5
sedEreFlag="$(test "$(uname)" = Darwin && echo E || echo r)"
6

  
7
sed () { "$(which sed)" -"$sedEreFlag" "$@";}
8

  
9
ifconfig en0|sed -n 's/^.* ([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+) .*$/\1/p'
0 10

  

Also available in: Unified diff