On Wed, 2003-03-05 at 07:19, zentara wrote:
> On 04 Mar 2003 22:58:20 -0700, [EMAIL PROTECTED] (Jdavis) wrote:
> 
> >Hello,
> >  I am writing a script to help a user turn a modem
> >on and off and adjust the routing tables on a 
> >Linux box. I am trying to call wvdial to do the dialing,
> >but it does not give control back to my script. I call
> >it like so
> >
> >if( $choice == 1){
> >     `wvdial`;
> >     print "connected";
> >}
> >
> >I also have tried..
> >
> >if( $choice == 1){
> >     `wvdial&`;
> >}
> >
> >but nothing after `wvdial` gets ran.
> >could someone offer me some advice...please :) ?
> 
> Backticks and system will run the program until  
> it finishes, then return control to the calling program.
> Exec will run the program, but never return control.
> What you want to do is "fork and exec"
> 
> 
> if($pid = fork() == 0)
>     {
>       exec("wvdial");
>     }
> 
> # this is all executed in the parent 
> #... 
> kill $pid;   #to terminate wvdial 
> 
> You can check whether the connection is
> good by checking the file "/var/run/ppp0.ip"

Thanks all who replied. I dont have a modem or wvdial
so when i go to the cust house today i will try the new methods
suggested. 

-- 
jd
[EMAIL PROTECTED]

Bad spellers of the world untie!

"I can't tell if I have worked all my life or 
if I have never worked a single day of my life"
                        Miguel de Icaza


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to