Tags

, ,

Well I finally got around to writing a script in order log into all my lab routers.  Why?  I got tired of typing R1, then password, breaking out and going to the next.  When you connect to 8 routers for every lab, it takes time.
So, below is the script I use for my SecureCRT session.    Pretty simple, just did a record of the first two and then edited the rest of them in.
It can also be found here for easier reading:
http://pastebin.com/NUdBENdc

—————————————————————–
#$language = “VBScript”
#$interface = “1.0”
crt.Screen.Synchronous = True
Sub Main
 crt.Screen.Send “r1” & chr(13)
 crt.Screen.WaitForString “Password: ”
 crt.Screen.Send “PassWord” & chr(13)
 crt.Screen.Send chr(13)
 crt.Screen.WaitForString “Rack1R1#”
 crt.Screen.Send chr(30) & “x2” & chr(13)
 crt.Screen.WaitForString “TS1#”
 
 crt.Screen.Send “r2” & chr(13)
 crt.Screen.WaitForString “Password: ”
 crt.Screen.Send “PassWord” & chr(13)
 crt.Screen.Send chr(13)
 crt.Screen.WaitForString “Rack1R2#”
 crt.Screen.Send chr(30) & “x3” & chr(13)
 crt.Screen.WaitForString “TS1#”
 
 crt.Screen.Send “r3” & chr(13)
 crt.Screen.WaitForString “Password: ”
 crt.Screen.Send “PassWord” & chr(13)
 crt.Screen.Send chr(13)
 crt.Screen.WaitForString “Rack1R3#”
 crt.Screen.Send chr(30) & “x4” & chr(13)
 crt.Screen.WaitForString “TS1#”
 
 crt.Screen.Send “r4” & chr(13)
 crt.Screen.WaitForString “Password: ”
 crt.Screen.Send “PassWord” & chr(13)
 crt.Screen.Send chr(13)
 crt.Screen.WaitForString “Rack1R4#”
 crt.Screen.Send chr(30) & “x5” & chr(13)
 crt.Screen.WaitForString “TS1#”
 
 crt.Screen.Send “r5” & chr(13)
 crt.Screen.WaitForString “Password: ”
 crt.Screen.Send “PassWord” & chr(13)
 crt.Screen.Send chr(13)
 crt.Screen.WaitForString “Rack1R5#”
 crt.Screen.Send chr(30) & “x6” & chr(13)
 crt.Screen.WaitForString “TS1#”
 
 crt.Screen.Send “r6” & chr(13)
 crt.Screen.WaitForString “Password: ”
 crt.Screen.Send “PassWord” & chr(13)
 crt.Screen.Send chr(13)
 crt.Screen.WaitForString “Rack1R6#”
 crt.Screen.Send chr(30) & “x7” & chr(13)
 crt.Screen.WaitForString “TS1#”
 
 crt.Screen.Send “r7” & chr(13)
 crt.Screen.WaitForString “Password: ”
 crt.Screen.Send “PassWord” & chr(13)
 crt.Screen.Send chr(13)
 crt.Screen.WaitForString “Rack1R7#”
 crt.Screen.Send chr(30) & “x8” & chr(13)
 crt.Screen.WaitForString “TS1#”
 
 crt.Screen.Send “r8” & chr(13)
 crt.Screen.WaitForString “Password: ”
 crt.Screen.Send “PassWord” & chr(13)
 crt.Screen.Send chr(13)
 crt.Screen.WaitForString “Rack1R8#”
 crt.Screen.Send chr(30) & “x9” & chr(13)
 crt.Screen.WaitForString “TS1#”
 
 crt.Screen.Send “1” & chr(13)
End Sub