On Thu, 25 Jun 1998, Zoki wrote:

> 
> I'm trying to make the...##@@%$ cron to connect to my ISP, send mail,
> download new ones and switch off. Pritty straight forward I would think.
> Nevertheless it doesn't work. Another mistake I made was thinking this
> would be simple.
> 

How about this:

-------------CUT--------------
#!/bin/bash
#
# Auto fetchmail
#

unalias -a
export PATH=/bin:/usr/bin:/sbin:/usr/sbin

TRIES=5
COUNT=0

until [ $COUNT = $TRIES ]
do  COUNT=$[COUNT + 1]
    ppp-on || {
        sleep 2m
        continue
    }
    sleep 40
    ifconfig  # What's this for?
    sendmail -q
    fetchmail
    sleep 5
    ppp-off
    exit 0
done

echo "We didn't connect.... sorry."
exit 1

# End
-------------CUT--------------

To debug, change the:
        #!/bin/bash"

to:
        #!/bin/bash -x

and the execution of each command will be echoed.

--
John Darrah (u05192)    | Dept: N/C Programming
Giddens Industries      |
PO box 3190             | Ph: (206) 767-4212 #229
Everett  WA    98203    | Fx: (206) 764-9639


-- 
  PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
http://www.redhat.com/RedHat-FAQ /RedHat-Errata /RedHat-Tips /mailing-lists
         To unsubscribe: mail [EMAIL PROTECTED] with 
                       "unsubscribe" as the Subject.

Reply via email to