On Wed, 5 Aug 1998, Stephen J. Carpenter wrote: > > 1. It has no provision for the possibility of fetchmail still being in > > action after 5 minutes (for example someone attaches a large file to an > > e-mail) > > > > 2. It has no way of handling a situation where fetchmail has stalled and > > needs to be restarted. > > > > Obviously, my scripting skills aren't that great. > > I just thought of an interesting fix for this...
for my scripting skills or the problem with my script? :) > (note my shell scripting sucks...but you should be able to > get the general idea from this..also I just cooked this up...pulled > it right out of my ass) Hey, at least you had an idea. I'm not even sure what all of it means. > #!/bin/bash > # note im not making ppp-mail is just a place holder > # ...its an example anyway ;) > > if [ -f /var/run/ppp-mail ] > fetchmail > rm -f /var/run/ppp-mail > exit 0 > fi This checks to see if /var/run/ppp-mail exists as an ordinary file, then runs fetchmail if it is. When fetchmail finishes, it deletes /var/run/ppp-mail. Right? Does the exit 0 end the script right then and there or what? > touch /var/run/ppp-mail This creates an empty /var/run/ppp-mail file, right? > $0 & # If you didn't have the test above this would make a mess What's the $0 & for? > exit 0 Hmm... another one of these. I think it makes sense to have one at the end of the script, although mine doesn't and it works. What I don't understand (because I'm clueless), is what testing for, removing and creating /var/run/ppp-mail would accomplish. Below is my script (with the boring connect/disconnect stuff removed). Any input is welcome. If you can give me a clue as to how your idea would fit into this mess, that would be great. #!/bin/sh # # Stuff to initiate ppp connection # # /home/pppusers/pppd.log is created by ip-up when connection # is established. This waits for that to happen. until test -r /home/pppusers/pppd.log do sleep 5s done fetchmail & sleep 4m killall fetchmail # Stuff to kill ppp connection below -- Unsubscribe? mail -s unsubscribe [EMAIL PROTECTED] < /dev/null