custom applescript for external ip address

Discussion in 'macOS' started by innominato5090, Oct 25, 2009.

  1. innominato5090 macrumors 6502


    Sep 4, 2009
    hi guys! hope I've chosen the right section to start this new thread.
    I'm looking for a solution to save the external ip address into a file on my dropbox folder, so I can easily read it from my MacBook when I'm not at home or on my iPhone and access via VNC to my Mac at home.
    I think that an applescript that runs in background and constantly update the ip (like every hour) should be the right solution but I can't figure how to create it! I'm quite a dumb with apple script editor, so an help would be highly appreciated! :D

  2. belvdr macrumors 603

    Aug 15, 2005
    How about registering for a free account from Then you just run a client and you can get something like:


    You can replace <yourname> with anything you want, so long as nobody else is using it.
  3. sammich macrumors 601


    Sep 26, 2006
    I don't think that updates when your IP changes. So it'll break.

    I've actually thought of this. But I haven't been able to successfully upload data to my webhost via ftp in terminal.

    In any case, I'll post the method in the hopes someone will help both of us out: THIS IS NOT A SOLUTION (yet)

    You can either run a chron job in terminal OR download NerdTool here. Open it, and create a new shell item.

    In that shell item you wil need to have the script for: writing a file of your ip to somewhere (hidden)

    curl --silent > /tmp/myip
    will grab your IP and store it in plain text.

    Now you could also include it to only update and upload when it's different.

    This is where someone comes in and tells us how to use ftp in the shell to upload to a protected directory.
  4. belvdr macrumors 603

    Aug 15, 2005
    Well, if you check out the site, it explains what it does (dynamic DNS). You have a client on the inside network updating the DNS entry, so it is updated whenever the IP changes. I do this all the time.

    Don't re-invent the wheel. A hostname is much easier to remember than constantly having to check the IP.
  5. innominato5090 thread starter macrumors 6502


    Sep 4, 2009
    that's a fantastic idea! actually my netgear that i use as modem (connected with my time capsule) has built-in dyndns support!
    I'll will try later, thank you very much!
  6. belvdr macrumors 603

    Aug 15, 2005
    You're welcome. FYI, don't have the built-in client update too often or they will disable your account. You just need to email them to re-enable, but just something to keep in mind.

    My Linksys running OpenWRT has the built-in client too and it works fine.

Share This Page