root/bin/local_ip @ 9189
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' |