I have created a script as under:
#!/bin/sh
# Start the connection pon
# Wait until the connection is made until ifconfig ppp0 | grep "inet addr" > /dev/null; do sleep 1; done;
# Get the mail and then poff. Using ; is better than && because # fetchmail exits with an error if it doesn't get any mail. fetchmail -d0 > /dev/null ; poff
I copied this from a posting I saw on a newsgroup and it works perfectly well when run by root from the command line. However if I set it up to be run as a root cron job it doesn't work as it should.
After the script has been started by cron I see an entry for the script and an entry for 'sleep 1' in the list of running processes.
If I run ifconfig ppp0 at this time I see a line starting 'inet addr' but the 'until' loop never exits.
Can anyone offer advice as to why this should be happening?
Barry Samuels