Anxiously Awaiting On Everything Eternal…

4Sep/070

IP -> Gmail

Something I have been meaning to do for a while is figure out how to get my machine to email me my IP address. Behold!

w3m http://www.whatismyip.com -dump | grep "Your IP Is" |
gawk '{print $4}' > /tmp/ip;

mailx -s "IP Address" jduv@gatech.edu < /tmp/ip

As usual since the format of my blog makes viewing long scripts difficult make sure the first string of commands is on a single line. The first line points a text based WWW browser called w3m to http://www.whatismyip.com and dumps the contents to a grep call for the string "Your IP Is." That in turn is piped to gawk for formatting and dumped to a file called ip in the /tmp folder.

Then the next line dumps the contents of that file to a mailx call with a subject of "IP Address" and then mails that to my email address. A cron script and simple filter inside Gmail later, and I have daily updates on what my machine's IP address is. Forget paying 30 bucks a month for a static IP!

IP Filter

Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


 

No trackbacks yet.