Posts

Showing posts with the label match string

Python Login Script for Cisco 2k Series Routers and display the command output in the window - Part2

Another Way to login to SecureCrt using python if there is ">" operator is as follows : This below script will help you login as well as search for the string mentioned at the beginning and out if found or not ************************** # $language = "Python" # $interface = "1.0" # Website: www.ifconfig.it # License: https://creativecommons.org/licenses/by-sa/4.0/legalcode def main():     # CONNECTION DATA     hostIP = "X.X.X.X"     username = "XXXXX"     password = "XXXX"     enablePassword = "XXXXX"     prompt = "#"     # PARAMETERS     command = "XXXXX"     searchString = "XXXXX"     reloadCommand = "XXXX"     # LOGIN STRINGS     loginStrings = ["Username","Password:",">","Password:"]     sendString = [username,password,"enable",enablePassword]     crt.Screen.Synchronous = True     # CONN...