« some action scripts for lithium | Main | farewell, heads »

what's my mac's current ip address?

Perhaps this is useful to somebody other than me? It'll tell you what your currently "active" IP address is - ie. if you're connected via both wireless and wired connections, it'll tell you which one'll win for default network traffic.

#! /bin/bash
ifconfig $(netstat -rn | awk '/^default/ {print $NF}' | head -1)\
 | grep 'inet ' | awk '{print $2}'

* 09:24 * · comments (1)

Comments

cool.

are there any good free thigs on the net you can hook into to disguise your IP address? work is getting painful, blocking every social networking site in existence, happily except flickr.

> Posted by tk at July 8, 2008 12:59 AM


Post a comment


Leave a comment