Esempio n. 1
0
	def do_list(self, args):
		"""Show the list of all discovered agents with their current status"""
		helpers.printAgentList(self.statusHandler.agentList)
Esempio n. 2
0
    # Create a status handler
    statusHandler = statusHandler.StatusHandler(masterKey)

    # Create a mainHandler
    mainHandler = mainHandler.MainHandler(dropboxHandler, statusHandler)

    # Create an AgentHandler
    agentHandler = agentHandler.AgentHandler(dropboxHandler, statusHandler)

    # Start the main background polling thread
    print helpers.color("[*] Starting Polling thread")
    pollingThread = pollingThread.PollingThread(dropboxHandler, statusHandler)
    pollingThread.doPoll()

    # Print the list of discoverd agents
    helpers.printAgentList(statusHandler.agentList)

    #--------------------------------------------------------------------------
    # Main command loop
    #--------------------------------------------------------------------------
    mainMenu = console.MainMenu(mainHandler, agentHandler, statusHandler)
    while True:
        try:
            mainMenu.cmdloop()
        #----------------------------------------------------------------------
        # handle ctrl+c's
        except KeyboardInterrupt as e:
            try:
                choice = raw_input(helpers.color("\n[>] Exit? [y/N] ", "red"))
                if choice.lower() != "" and choice.lower()[0] == "y":
                    pollingThread.stopPollingThread()