Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Making MacOS report its IP via email on startup

Making MacOS report its IP via email on startup
Thread Tools
Fresh-Faced Recruit
Join Date: Jul 2006
Status: Offline
Reply With Quote
Apr 29, 2006, 04:38 PM
 
Hello...

I am the family tech support guy and 'manage' about 5 machines all over the place using Apple Remote Desktop 3. Now, since these machines get dynamic IPs, I whipped up a little applescript that would tell me the machine's LAN IP and the WAN IP. Here it is:

[FONT="Courier New"]set theData12 to do shell script "ifconfig | grep \"inet\" | tail -1"
set j to the offset of "inet" in theData12
set k to the offset of "netmask" in theData12
set theIPLocal to (characters (j + 5) thru (k - 2) of theData12) as string

set theData14 to do shell script "curl -l \"http://whatsmyip.islayer.net/\""

set finaloutput to "LAN IP: " & theIPLocal & return & "WAN IP: " & theData14 as string

do shell script "echo " & finaloutput & " | mail -s 'IPSender Alert' myemail@myisp.com" [/FONT]

i've set it as the login item, and it runs. but for some reason, i'm not getting the email. it doesn't seem like it's going out even. could it be that the ISP is blocking local SMTP communications?

any advice or workarounds are much appreciated!

thanks
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 10:47 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2