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" -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]