defmodule Syphon do
require Logger
require OSScan
{stream, exit_code} = OSScan.scan("127.0.0.1")
case exit_code do
0 -> stream
|> Stream.each(&IO.puts/1)
|> Stream.run()
Logger.info("Scan succcessfuly completed")
_ -> Logger.error("Scan failed with exit code #{exit_code}")
end
end
I don't know if it's the right way to do this but I'm using a stream to print out the result of my nmap scans. My program hangs infinitely when I run it which is kinda fine, I'll search for tips on process management after. However, the Elixir Language Server does too which is problematic because it means I can't get any code completion/help!
Thanks for the help!
-noctis