[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[pankaj_a@techlinkindia.com: Re: Automatic dialing]





Dear Mr. Brain;
Thank you very much for immediate reply.
I think u r right that wvdial does not close the session because suppose if
I run"wvdial" in console one then it is continuously checks the process & we
can
not use other commands .If  we have to use  commands then we have to go
second console.
So is there any other script which can fulfill our requirment.
Our scenario is
Through "crond"  script should  run at perticular time interval & then
through this
script
1.Connect to intenet through the dialup modem.
2.Sends the mails.
3.Retrive the mails.
4.Close the PPP Daemon.

If there is  any other method  which fulfill this scenario please tell me.
Once again thanks for co-operation.
With regards
Pankaj


----- Original Message -----
From: Brian Candler <B.Candler@pobox.com>
To: pankaj_a <pankaj_a@techlinkindia.com>
Cc: <tcpws@psg.com>
Sent: Monday, May 28, 2001 2:19 PM
Subject: Re: Automatic dialing


>
> On Fri, May 28, 1999 at 11:16:21AM +0530, pankaj_a wrote:
> > #!bin/bash
> > wvdial
> > /usr/sbin/sendmail -q -v  $*
> > /usr/bin/fetchmail -k -a -v -d 0 -N
> > sleep 5
> > killall pppd
> > killall wvdial
> >
> > Now there is a TWO case
> > 1;   when I control this process by "crond" configured through linuxconf
> > then
> >      modem is dialing perfect at proper time shedule  but next proceses
i.e.
> > a) sending mails b)fatching mails  c)  stoping wvdial & pppd. is not
going
> > on I mean to say that sendmail, fetchmail etc r not executing .
>
> Does cron mail you any output?
> If not, try adding this to the top of the script after #!/bin/bash:
>    set -x
> The script should print a line for each command it executes, and this
should
> be mailed to you.
>
> There are some possible problems I can see:
>
> (1) I would drop the '$*' from the sendmail command line. I am not sure
what
> this will expand to when the job is run under cron, but it is quite likely
> to generate a sendmail error. When run under an interactive shell it will
> expand to whatever parameters you gave to the script (i.e. usually empty)
>
> (2) Where is your .fetchmailrc? Are you running this script as root, then
> you need /root/.fetchmailrc
>
> (3) I have never used wvdial. But are you _sure_ that it doesn't continue
> until after pppd has actually completed negotiating a working session? If
it
> terminates when pppd has started but it has not finished negotiating the
> link, then sendmail and fetchmail will both be unable to reach the
Internet
> (no defaultroute will have been installed).
>
> To test this theory, try modifying your script as:
>
> wvdial
> echo "Routing table after wvdial"
> netstat -rn
> sleep 15
> echo "Routing table after 15 seconds"
> netstat -rn
>
> Check for defaultroute (0.0.0.0). If it doesn't exist in the first entry
but
> it does in the second, then there's your problem.
>
> You can either work out what is an optimal value of 'sleep', or you can
> write a script to wait until defaultroute has appeared.
>
> (4) A problem which often occurs with cron jobs is that the PATH
environment
> variable is set differently, but since you have explicitly given the path
to
> sendmail and fetchmail, that shouldn't be a problem.
>
> Regards,
>
> Brian.

__________________________________________________
Techlink Devices Pvt. Ltd. Mumbai.