MTNL Triband - No Installation Charges?

  • Thread starter Thread starter shouvik
  • Start date Start date
  • Replies Replies 19
  • Views Views 4,021
ok! slap me if im wrong (ooh inviting trouble)but i think we can do the same thing without the "scriptable" telnet progg!just enter the commands from "login" to "reboot" in sequence! ina TEXT FILE!!then make a batch file which "pipes" (|) it (THE TEXTFILE) to telnet! use the scheduler to schedule the bacth file....i did try but freakin thin is does not work!some1 post a nice exmaple
 
Nice tip stole 😉
 
Originally posted by St0le@Dec 31 2005, 09:10 AM
just enter  the commands from "login" to "reboot" in sequence! ina TEXT FILE!!
then make a batch file which "pipes" (|) it (THE TEXTFILE) to telnet!
[snapback]37851[/snapback]
[/quote]

There is a small problem with this. Pipe will dump content of the file at once. But there is a slight delay between Username: and Password: prompts in unix login shell.

Login shell works like this:

1. Display username: or login: prompt
2. Wait for Enter key
3. Flush input file (stdin)
4. Display password: prompt
5. Wait for enter key

problem is with line 3.

As soon as telnet starts, it will get all the lines in text file in stdin. username prompt will be displayed. telnet will read username from stdin (all chars in first line),
and then it will flush stdin. Afterwhich there will not be anything to read in stdin. It will display password promts and wit for \n in stdin. But since stdin is empty, \n will never come.

That's the reson you will see wait or expect commands in telnet scripts.
 
Originally posted by St0le@Dec 31 2005, 09:10 AM
i did try but freakin thin is does not work!
some1 post a nice exmaple
[snapback]37851[/snapback]
[/quote]

St0le, why don't you want to use the Telnet Scripting app ? It works very well, I'm using it and am having no problems with it.

Here's a direct download link to the app: http://www.mario.freeandinstant.com/shared/tst10.zip

It's a standalone exe, and the zip file is only a 190 KB download.

1) Unzip the contents of the zip file to any folder, say C:\ . The file TST10.exe is the Telnet Scripting program that we need to use.

2) Create a text file (say C:\RouterReboot.txt) with these commands :

Code:
192.168.1.1 23WAIT "login"SEND "admin\m"WAIT "Password"SEND "admin\m"WAIT "#"SEND "reboot\m"WAIT "#"
Replace "admin" with your own router login id and password on lines 3 and 5.

3) Now just add a scheduled task that looks like this :



Note the command line parameter in the Run box, which is /r: followed immediately by the name of the text file created in Step 2 i.e RouterReboot.txt

The Start in box must contain the path where the text file is located, in this case : C:\

4) Make sure you enter your correct Windows login password by clicking on the Set password button.

5) Configure the time when you want the task to run on the Schedule tab. For MTNL, this is typically just after 12:00 AM, and just before 8 AM.

That's it ! Your router should reboot properly at the scheduled time.

Let me know if you're still having any problems.
 
eh!...i have nothing against the scriptable telnet 🙂..it may work..my suggestion was just my solution to the problem...btw i dont own a NU plan (heahaa)...thanx for the offer though..You ROQ!! 🙂netfreak, ill give it another shot...i know it can be done!!u know my motto:try and try till some1else pity's u and does it for u! 🙂
 

Top