thanks.<br><br><div class="gmail_quote">On Wed, Dec 30, 2009 at 5:18 PM, Loganaden Velvindron <span dir="ltr"><<a href="mailto:gnukid1@yahoo.co.uk">gnukid1@yahoo.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<table cellspacing="0" cellpadding="0" border="0"><tbody><tr><td valign="top" style="font:inherit">Greetings,<br><br>Happy new year to all of you,<br><br>During the december presentation, I argued that expect was useful<br>
to non-programmers (end-users) as well. <br><br>Here's a little script that automates resetting ADSL. One can use cron<br>to run it periodically, or alternatively extend the expect script using<br>looping constructs.<br>
<br>It's pretty useful when you need to get a new IP for services such as rapidshare<br>that force you to wait after downloading the first file.<br><br>Please note that's my ADSL's setup is a little bit different from typical<br>
installations.<br><br>The ADSL modem acts as a bridge (L1/L2), and a small pentium 1 is used<br>for initiating pppoE requests (the pentium 1 box gets the dynamic public<br>IP).<br><br>The script may be adapted to your modem's telnet interface :-)<br>
<br>#!/usr/bin/expect
 -f                                                            <br>set timeout 10<br>spawn chmod 700 fw.exp<br>spawn ssh <a href="mailto:tontux@192.168.0.0" target="_blank">tontux@192.168.0.0</a> -p 22<br>expect {<br>    "yes/no" {send "yes\r" ; exp_continue }<br>
    "assword"  { send "lugm\r" ; exp_continue }<br><br>    "$ " {send "sudo ifconfig pppoe0 destroy ; sudo sh /etc/netstart pppoe0 ; e\<br>xit\r";exp_continue}<br>    default { puts "OOPS"  }<br>
<br>}<br><br><br><br></td></tr></tbody></table><br>


      <br>__________________________________________________________<br>
Linux User Group of Mauritius (LUGM) Discuss mailing list<br>
Website: <a href="http://lugm.org" target="_blank">http://lugm.org</a><br>
Mailing list archive: <a href="http://lugm.org/pipermail/discuss_lugm.org/" target="_blank">http://lugm.org/pipermail/discuss_lugm.org/</a><br>
Forum: <a href="http://lugm.org/forum/" target="_blank">http://lugm.org/forum/</a><br>
IRC: #<a href="http://linux.mu" target="_blank">linux.mu</a> on Freenode<br>
<br></blockquote></div><br><br clear="all"><br>-- <br>$3|v3n<br>