Revision 1677
Added by Aaron Marcuse-Kubitza almost 13 years ago
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
Added local_ip to get local IP address