PPP scripts - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

PPP scripts


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
'' AT

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.

Sign In or Register to comment.