Merge pull request #3 from BraydonKains/kill_process
Added ability to kill process found on portpull/5/head
commit
8aee1e9788
@ -0,0 +1,13 @@
|
|||||||
|
module CommandRunner
|
||||||
|
def self.run_ltnp : LtnpOperator
|
||||||
|
io = IO::Memory.new
|
||||||
|
Process.run("netstat -ltnp", shell: true, output: io)
|
||||||
|
LtnpOperator.new io.to_s
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.run_kill(pid : String) : String
|
||||||
|
io = IO::Memory.new
|
||||||
|
Process.run("kill #{pid}", shell: true, output: io)
|
||||||
|
io.to_s
|
||||||
|
end
|
||||||
|
end
|
@ -1,7 +0,0 @@
|
|||||||
module NetstatRunner
|
|
||||||
def self.run_ltnp : LtnpOperator
|
|
||||||
io = IO::Memory.new
|
|
||||||
Process.run("sudo netstat -ltnp", shell: true, output: io)
|
|
||||||
LtnpOperator.new io.to_s
|
|
||||||
end
|
|
||||||
end
|
|
Loading…
Reference in New Issue