You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
eznet-cli/modules/command_runner.cr

14 lines
296 B
Crystal

module CommandRunner
def self.run_ltnp : String
io = IO::Memory.new
Process.run("netstat -ltnp", shell: true, output: io)
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