MTNL Triband - No Installation Charges?

  • Thread starter shouvik
  • Start date
  • Replies: Replies 19
  • Views: Views 3,824
St0le

St0le

The Funny One
Messages
743
Location
NA
ISP
MTNL
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
 
shouvik

shouvik

Messages
931
Location
Delhi -NCR
ISP
Airtel
Nice tip stole ;)
 
N

netfreak

Regulars
Messages
2,229
Location
NA
ISP
Airtel GPRS EDGE + VSNL
Originally posted by [email protected] 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.
 
M

mario_a

Regulars
Messages
246
Location
NA
ISP
MTNL 590 NU
Originally posted by [email protected] 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.
 
St0le

St0le

The Funny One
Messages
743
Location
NA
ISP
MTNL
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! :)
 

Similar threads

AbhishekMSharma
Replies
26
Views
13,987
SuperFlyBoy
N
Replies
15
Views
4,069
viralbug
G
Replies
1
Views
1,035
superprash2003