Hi, On 12/03/14 09:00, li...@sbt.net.au wrote: > I have a basic script to watching mailbox for new emails with > cygwin/getmail, that works OK, BUT, occasionally, ADSL goes down, > generally, it comes back promptly, though, not always ... > how can I make some basic connectivity test (against the mail server) to > delay getmail until connectivity exists ?
Hmm, normally you'd use the ping command, although with cygwin it may be interesting. Apparently there are two different ping commands in a cygwin environment, each with its own issues, so you'd have to try both and see if you can get one of them to do some useful thing (possibly in combination with grep). You could put a "sleep 300" command in the loop, so that it waits 5 minutes before retrying. That may reduce the looping to a level which is no longer a problem. Finally, you should probably put an actual loop in the script rather than calling the script as the last command. Put "while true; do" at the top and "done" at the bottom instead of calling the script again. The way it is now, each time around the loop will run up a new process, which will hang around forever. (Alternately, turn the last line into "exec /home/voytek/sms" so the new copy of the script replaces the old one.) Cheers Jiri -- Jiří Baum <j...@baum.com.au> Sabik Software Solutions Pty Ltd 0413 183 117 http://www.baum.com.au/sabik -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html