PPP scripts - Programmers Heaven

Howdy, Stranger!

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

Categories

PPP scripts


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
Sign In or Register to comment.