DarkBlood Posted May 26, 2010 Posted May 26, 2010 (edited) I'm searching a way to make a script for a simple TELNET login in my router, it would send username and password then would send a command and finally close telnet session, ALL of that using only AutoIT and without user interaction (AUTOMATED & HIDED).If anyone wants to help me thanks in advance!-----What I want to automate? This:(It's for reconnect to change IP, for the router of the ISP Arnet Discus DRG A112)Start Menu > Run..: telnet 10.0.0.2Username: adminPassword: alvlgeddlCommand 1: ppp config 0.0.33 downCommand 2: ppp config 0.0.33 upCommand 3: logout-----edit:I made it!! YEAH! works fine full-auto.But... have some problems because of my router, if session was not closed correctly or opens sessions too fast, it locks and not permit any more connections, even worse don't returns any error, just close your telnet session instantly after send "Start > Run..: telnet 10.0.0.2".TcpStartUp () $RouterIP = tcpconnect("10.0.0.2", "23") Do Sleep(100) Until $RouterIP <> "-1" While 1 Sleep(100) $TCPRecv = TCPRecv($RouterIP,"5000") ;~ ConsoleWrite($TCPRecv) ;for debug test ;~ MsgBox("","",$TCPRecv) ;for debug test If StringInStr($TCPRecv, "Login:") > 0 Then TCPSend($RouterIP, "admin" & @crlf) ElseIf StringInStr($TCPRecv, "Password:") > 0 Then TCPSend($RouterIP, "alvlgeddl" & @crlf) TCPSend($RouterIP, "ppp config 0.0.33 down" & @crlf) TCPSend($RouterIP, "ppp config 0.0.33 up" & @crlf) TCPSend($RouterIP, "logout" & @crlf) ElseIf StringInStr($TCPRecv, "have a nice day") > 0 Then ExitLoop EndIf WEnd TCPShutdown() Edited June 15, 2010 by DarkBlood
shaqan Posted July 15, 2010 Posted July 15, 2010 (edited) Thanks a lot man.. Saved a lot of nerves for me.. needed general idea how to go about implementing similar thing for SpeedTouch 780WL Edited July 15, 2010 by shaqan
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now