View Single Post
  #18  
Old 17.01.2011, 00:22
dedosoa
Guest
 
Posts: n/a
Default Linux users (Ubuntu at least)

hi there!! I wroted this script and posted it in ubuntu help forum. It should work on every linux/unix system i think with a ppp based internet connection (think it is said like this) Works via telnet generally on those systems.
This is muy guide for ubuntu/debian users.

First of all, script is written in bash expect (think is like that)we have to install the expect lib via synaptic or terminal

Code:
sudo apt-get install expect
We create the .sh file and put it in home/"user"/JDownloader/ i do it like that:

Code:
sudo gedit /home/"user"/JDownloader/reconnect.sh
and paste the text above as it is but changing your own data

Code:
#! /usr/bin/expect 

spawn telnet 192.168.1.1 (or your routers' address) 
expect "Login:" 
send "admin or your login\r" 
sleep 2 
expect "password:" 
send "yourpassword\r" 
sleep 2 
expect ">" 
send "ppp config ppp0 down\r" 
sleep 5 
expect ">" 
send "ppp config ppp0 up\r" 
sleep 5 
expect ">" 
send "exit\r"
we give script's permissions

Code:
sudo chmod +x /home/"youruser"/JDownloader/reconnect.sh
then in settings>>reconnection in external tab in command select your script's route


After all you can tweak reconnection times, in advanced. Mines are

30
4
40

wich gives me a reconection time of 30 seconds, think it can be improved.

Hope it helps.
Reply With Quote