Koustubha Kale wrote:
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.
Thanks.. I have the same idea and am working on it. Not being used to bash scripting or qt for that matter ( the only programming I know is with Java ) its taking a bit of doing. But I will get there eventually. Will post when done. In the meanwhile any tips of how to do this are very welcome. KK
____________________________________________________________________________________ Be a PS3 game guru. Get your game face on with the latest PS3 news and previews at Yahoo! Games. http://videogames.yahoo.com/platform?platform=120121