Re: Detecting if connected to internet
Re: Detecting if connected to internet
- Subject: Re: Detecting if connected to internet
- From: Doug McNutt <email@hidden>
- Date: Fri, 23 May 2008 18:27:17 -0600
At 13:36 -0400 5/23/08, Dan Doughtie wrote:
I've written an Applescript that will make a backup of a Filemaker Database with unique name then uses CURL to ftp it to a backup server. This DB is a standalone and I don't trust the user to make an offline backup for safety purposes. They travel a lot and I'm afraid a stolen or dropped laptop would really hurt if they lost this file.
But sometimes they work off line. I want to add a line that would check to see if they were on the internet and if so, then send the backup, else, not.
Any suggested approaches? Ping something and if it fails then assume you're offline? Is there an OS status that would indicate this?
curl is pretty good at returning error codes. You could just make an attempt and fail quietly if it doesn't work. You can give curl a short time-out value.
How about a "dig" asking for the IP address that you want to talk to? It might be frustrated by a local cache but somehow I doubt that your users are running a private BIND server.
--
--> From the U S of A, the only socialist country that refuses to admit it. <--
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden