Re: Checking for an internet connectio

2012-05-01 Thread Phil Davis
Thanks for the heads-up Peter! Phil On 5/1/12 4:34 PM, Peter Haworth wrote: Hi Phil, Up to now, I've been using this on a Mac and it has worked fine as mentioned, despite the apparent discrepancy between between the empty/zero return code that's been mentioned. I tried it on Windows today and

Re: Checking for an internet connectio

2012-05-01 Thread Peter Haworth
Hi Phil, Up to now, I've been using this on a Mac and it has worked fine as mentioned, despite the apparent discrepancy between between the empty/zero return code that's been mentioned. I tried it on Windows today and found that it was always returning false. Turns out the -t parameter on a Mac is

Re: Checking for an internet connectio

2012-05-01 Thread Peter Haworth
Hi Tim, I've been trying this procedure out today and it seems to work just fine, at least on a Mac, even though the man page for ping says it returns zero if successful, not empty and the procedure is treating any non-empty result as failure. Not sure why taht is. Pete lcSQL Software

Re: Checking for an internet connectio

2012-04-30 Thread Peter Haworth
Thanks for sharing it Phil. It seems to be working fine for me. Pete lcSQL Software On Mon, Apr 30, 2012 at 10:48 AM, Phil Davis wrote: > Hi Bob, > > Have at it! You and others have expressed great ideas for improvements, > given various changes in the context and purpo

Re: Checking for an internet connectio

2012-04-30 Thread Phil Davis
Hi Bob, Have at it! You and others have expressed great ideas for improvements, given various changes in the context and purpose for which it might be used. I'm just glad to share it, and it's fun to see others adapt it for their needs (and offer suggestions for core improvements). Phil On

Re: Checking for an internet connectio

2012-04-30 Thread Bob Sneidar
Maybe have a means to change the domain in an Internet Setup card? I have a database setup card in all of my database enabled apps which attempts a connection which the user was initially prompted to set up. I set a global called connected based on the results of the attempt. I check the global

Re: Checking for an internet connectio

2012-04-30 Thread Bob Sneidar
Nice function. Simple and effective. What might make this a tad more better is to have a list of 5 domains, in case for some reason Google ever goes away or renames itself (hey it could happen!). Also, an alternate FTP method might be nice upon failure of ping, as some techs block ICMP at the fi

Re: Checking for an internet connectio

2012-04-29 Thread Tim Jones
Urgh - autocorrect sux! The actual text may "vary" from one OS update to another Tim On Apr 29, 2012, at 11:02 AM, Tim Jones wrote: > Pete, > > It's a good idea to always check the error code returned from a shell > command. The actual text may various from one OS update to another,

Re: Checking for an internet connectio

2012-04-29 Thread Tim Jones
Pete, It's a good idea to always check the error code returned from a shell command. The actual text may various from one OS update to another, so depending of the text returned can be a quick way to introduce an odd "bug" that works on one platform, but not on another. The man page will desc

Re: Checking for an internet connectio

2012-04-29 Thread Peter Haworth
Hi Phil, Double checking on the code below in your script. The man page for ping in OS X and Linux say that ping has an exit code of zero if no errors are encountered. Should the test on tResult be for zero or have you found that empty works too? Thanks, Pete lcSQL Software

Re: Checking for an internet connectio

2012-04-29 Thread Peter Haworth
Yes, Linux would be a useful addition. I googled linux ping and found the man page which says the format would be: "ping -c 1 -w 5" && pTargetDomain" ...yet a third variation! Pete lcSQL Software On Sat, Apr 28, 2012 at 5:59 PM, Phil Davis wrote: > Sorry to disappoin

Re: Checking for an internet connectio

2012-04-29 Thread Peter Haworth
Thanks Dar. You're right, Phil's solution answers a better question than the one I asked since it kills two birds with one stone - is there an internet connection and is the server responding. Pete lcSQL Software On Sat, Apr 28, 2012 at 3:40 PM, Dar Scott wrote: > Hi, P

Re: Checking for an internet connectio

2012-04-28 Thread Phil Davis
Sorry to disappoint, Mark. I'm certainly not anti-Linux; heck, Linus Torvalds and I have the same barber! But I don't have a Linux machine and don't really know enough about the different flavors to know what 'ping' format(s) to use. BUT - feel free to offer a 'case' statement that handles Linu

Re: Checking for an internet connectio

2012-04-28 Thread Dar Scott
Hi, Peter, I like Phil's solution, but it does answer a slightly different question from you said you want to ask. I think it is a better question. It answers not only if there is an Internet connection but also whether your update server is online and reachable. That might be more of the q

Re: Checking for an internet connectio

2012-04-28 Thread Mark Wieder
Phil- Saturday, April 28, 2012, 12:30:48 PM, you wrote: > default -- all other OSes > answer "This app cannot run on the" && the platform && > "platform." Wot, no linux? :-( -- -Mark Wieder mwie...@ahsoftware.net ___ use-liv

Re: Checking for an internet connectio

2012-04-28 Thread Peter Haworth
Great, thanks a lot Phil, I'll give that a whirl. Pete lcSQL Software On Sat, Apr 28, 2012 at 12:30 PM, Phil Davis wrote: > Hi Peter, > > I use "ping" to see if a given server is available. There are fewer bad > things that can happen using this approach than trying to g

Re: Checking for an internet connectio

2012-04-28 Thread Phil Davis
Hi Peter, I use "ping" to see if a given server is available. There are fewer bad things that can happen using this approach than trying to get a URL. The following code came from a recent project (slightly modified to protect the innocent) - watch line wraps: on mouseUp answer "Connecti

Checking for an internet connectio

2012-04-28 Thread Peter Haworth
Just put together a procedure for checking for software updates from my SQLiteAdmin program. All works great but I'm wondering the best way to check if there is an internet connection. I tried this out by disconnecting my computer from my wireless router and I got an"invalid host address" message