LINUX programming

Moderators: ITA
Number of threads: 1347
Number of posts: 2935

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
PPP scripts Posted by ruchika on 26 Aug 2003 at 2:25 PM

Hi,

I have a shell script that establishes a PPP connection. I have a ppp-on script that runs pppd and a ppp-on-dialer script that runs chat. I am getting confused here -

1) What processes should I look for to make sure that pppd and chat are running? I see /var/run/ppp0.pid sometimes, but sometimes its not there. There is also /var/run/pppd.tdb which doesn't go away irrespective of whether pppd is running or not. What is pppd.tdb file for?

2) What process corresponds to chat?

3) The ppp-on script starts ppp-on-dialer script. I run ppp-on script from my C function using system call. Using the following two lines, I can know the exit code of ppp-on.
int ret = system("./ppp-on")
printf("%d", WEXITSTATUS(ret));

But how can I know the return code of chat? This is how my chat script looks.

exec chat -v -s
ABORT 'RING'
ABORT 'NO CARRIER'
'' AT
TIMEOUT 3
OK ATD$TELEPHONE
TIMEOUT 45
CONNECT ''

4) Is there a way of specifying the number of times chat should try to establish connection before returning failure?

5) Should ppp-off script just try to kill ppp0.pid or also kill pppd.tdb? Is there any other cleanup required when closing ppp connection?


Thanks for your help.

Ruchika



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.