Koustubha Kale wrote:



After you are logged in give the command 'route add default ppp0'
as root or sudo, from a second terminal assuming that your wvdial
is ppp0. At office, continue to use it as before.




I really would like to make it into a simple script whith an icon
which i can double click to start the vdata card & when i close it my
office route is put back in place. I have started on it. I can get
the script to dial and connect but then wvdial does not return and my
next comand to make ppp0 default route does not execute. Also i would
like to trap the close so I can put the office route back as default.
 Any tips?


I don't know the actual commands to use but here is an algorithm that will help in making the script. You only need to google for the correct syntax or programmers on this list can also help. Another point, in order to run a command in the background add an '&' (amphersand) sign after the command. That will return the command prompt back to you. Here goes......

wvdial tata &
For i = 1 to 10 ( your choice of total time )
If ppp0 is up
then
sudo route add default ppp0 ; Exit ( ask for password or add it in the command )
Else
If i = 10
then
Exit
else wait 3 seconds
Next i

To kill the ppp0,

ifdown ppp0 ( not very sure about it but try it out separately to kill wvdial )
sudo route add default eth0 ( or whatever)
Exit.

You could use QT to make a VB like window with 2 buttons, one for connect and one for disconnect and point the buttons to the respective scripts.

Regards,

Rony.

                
___________________________________________________________ All New Yahoo! Mail – Tired of [EMAIL PROTECTED]@! come-ons? Let our SpamGuard protect you. http://uk.docs.yahoo.com/nowyoucan.html


--
http://mm.glug-bom.org/mailman/listinfo/linuxers

Reply via email to