Automator function to find internet IP address?

Discussion in 'Mac Apps and Mac App Store' started by Killyp, Jul 28, 2006.

  1. Killyp macrumors 68040

    Killyp

    Joined:
    Jun 14, 2006
    #1
    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?
     
  2. projectle macrumors 6502

    Joined:
    Oct 11, 2005
    #2
    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.
     
  3. Killyp thread starter macrumors 68040

    Killyp

    Joined:
    Jun 14, 2006
  4. projectle macrumors 6502

    Joined:
    Oct 11, 2005
    #4
    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
     

Share This Page