I have a script that runs every 15 minutes to download files when they become available. It works great from cron. Well it did until I added this:
set myIP to getInternalIP()
if myIP is " unknown " then
return
-- for testing
--display dialog "you are not connected"
end if
-- my script
to getInternalIP()
set the_interface to 0
repeat
set ip_internal to ""
try
set ip_internal to do shell script ("ipconfig getifaddr en" & the_interface)
end try
if ip_internal is not "" then exit repeat
set the_interface to the_interface + 1
if the_interface = 5 then
set ip_internal to " unknown "
exit repeat
end if
end repeat
return ip_internal
end getInternalIP
Now when I run it out of cron it doesn’t see it’s connection and returns ( or tells me I am not connected if the display dialog is uncommented. )
I call it from cron like this
I can run this manually by clicking on it and from the command line without this problem. Anyone know what the problem might be? I don’t need to know my ip I just need to know if I have a network connection so I don’t call something that will hang if it doesn’t have network.
Thanks for any help.
Peace,
Lois
Browser: Firefox 2.0.0.4
Operating System: Mac OS X (10.4)