View Full Version : Automator function to find internet IP address?
Killyp
Jul 28, 2006, 06:35 PM
The recent thread about the stolen MBP has made me wonder if I can do something about this on my MBP.
I was thinking it would be cool if I could get my MBP to send an email with it's internet IP address to a different email account (a hotmail account) on each startup? How would I do this?
projectle
Jul 28, 2006, 06:57 PM
Do you need it to get your external IP address (Network Address Translation) or would it be an enviroment without NAT?
If it is without nat, what you could do is write a very quick batch script
ifconfig en1 > /Volumes/ftp_server/current_ip.txt
If you use NAT, then you could just use automator to send you an e-mail every day and then just look at the header of the e-mail to get the current external IP address of the computer.
Killyp
Jul 28, 2006, 07:02 PM
That's what I want! Many thanks!
projectle
Jul 28, 2006, 09:43 PM
The bonus of the batch script is that it can run almost undetected through cron as it would only take 1-2 cycles where it would appear in the Activity Monitor. Additionally, if you install wget, you can do the following to get the external IP address...
wget http://www.whatismyip.org/ > /Volumes/ftp/current_ip.txt
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.