[lugm.org] Addendum for December Technical presentation

selven pcthegreat at gmail.com
Wed Dec 30 19:57:52 UTC 2009


thanks.

On Wed, Dec 30, 2009 at 5:18 PM, Loganaden Velvindron
<gnukid1 at yahoo.co.uk>wrote:

> Greetings,
>
> Happy new year to all of you,
>
> During the december presentation, I argued that expect was useful
> to non-programmers (end-users) as well.
>
> Here's a little script that automates resetting ADSL. One can use cron
> to run it periodically, or alternatively extend the expect script using
> looping constructs.
>
> It's pretty useful when you need to get a new IP for services such as
> rapidshare
> that force you to wait after downloading the first file.
>
> Please note that's my ADSL's setup is a little bit different from typical
> installations.
>
> The ADSL modem acts as a bridge (L1/L2), and a small pentium 1 is used
> for initiating pppoE requests (the pentium 1 box gets the dynamic public
> IP).
>
> The script may be adapted to your modem's telnet interface :-)
>
> #!/usr/bin/expect
> -f
> set timeout 10
> spawn chmod 700 fw.exp
> spawn ssh tontux at 192.168.0.0 -p 22
> expect {
>     "yes/no" {send "yes\r" ; exp_continue }
>     "assword"  { send "lugm\r" ; exp_continue }
>
>     "$ " {send "sudo ifconfig pppoe0 destroy ; sudo sh /etc/netstart pppoe0
> ; e\
> xit\r";exp_continue}
>     default { puts "OOPS"  }
>
> }
>
>
>
>
>
> __________________________________________________________
> Linux User Group of Mauritius (LUGM) Discuss mailing list
> Website: http://lugm.org
> Mailing list archive: http://lugm.org/pipermail/discuss_lugm.org/
> Forum: http://lugm.org/forum/
> IRC: #linux.mu on Freenode
>
>


-- 
$3|v3n
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://discuss.lugm.org/pipermail/discuss_discuss.lugm.org/attachments/20091230/8bfb2ad3/attachment.html>


More information about the Discuss mailing list