|
|
|
@ -109,8 +109,13 @@ class Apps(Actor) :
|
|
|
|
|
self.execute([app,args])
|
|
|
|
|
|
|
|
|
|
def kill(self,name) :
|
|
|
|
|
args = "".join(["-eo pid,command|grep -Ei ",name.lower(),'|grep -E "^ {0,1}[0-9]+" -o|xargs kill -9'])
|
|
|
|
|
self.execute(["ps",args])
|
|
|
|
|
"""
|
|
|
|
|
kill processes given the name, The function will not be case sensitive and partial names are accepted
|
|
|
|
|
@NOTE: Make sure the reference to the app is not ambiguous
|
|
|
|
|
"""
|
|
|
|
|
args = "".join(["-eo pid,command|grep -E -i ",name.lower(),'|grep -E "^ {0,}[0-9]+" -o|xargs kill -9'])
|
|
|
|
|
self.execute(["ps",[args] ])
|
|
|
|
|
print args
|
|
|
|
|
def analyze(self,logs) :
|
|
|
|
|
"""
|
|
|
|
|
This function is designed to analyze a few logs and take appropriate action
|
|
|
|
@ -410,7 +415,9 @@ class Orchestrator(Actor):
|
|
|
|
|
# class Alert(Actor):
|
|
|
|
|
# def process(self,item):
|
|
|
|
|
# pass
|
|
|
|
|
|
|
|
|
|
conf = {"/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome":"https://the-phi.com"}
|
|
|
|
|
a = Actor.instance('Apps',conf)
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
|
thread = Orchestrator()
|
|
|
|
|
thread.start()
|
|
|
|
|
|
|
|
|
|