View Single Post
  #10  
Old 07-26-2016, 08:12 AM
rleon rleon is offline
Registered User
 
Join Date: Jan 2008
Posts: 116
ok .. I cant get the python script to loop through a list of hosts and run commands, so my goal was to wrap a secure crt python script into a shell script in on my mac. I can shell script the loop and everything else I need to do then execute the crt script with the commands I need ran from the shell script.

Im very confident it would work if i can just execute the crt script from the current session ...

Code:
# $language = "python"
# $interface = "1.0"

def main():
        crt.Screen.Synchronous = True

        for g_strHost in open("/Users/rleon16/hosts", "r"):

         crt.Screen.Send("s " + line + '\r')

        crt.Screen.WaitForString("word: ")
        crt.Screen.Send("changeme" + chr(13))
        crt.Screen.WaitForString("-> ")
        crt.Screen.Send("exit" + chr(13))

        crt.Screen.WaitForString("# ")

        crt.Screen.Synchronous = False


main()
Reply With Quote