I need to add the functionality to output the entire line a string is found on. So here's the code I have working so far.
if type == "asa"
if File.readlines(file).grep(/http server enabled/).any?
$httpserver_failures.push(file)
out.puts "FAILED: does have http enabled"
else
$httpserver_passes.push(file)
out.puts "PASSED: does not have http enabled"
end
elsif type == "ios"
if File.readlines(file).grep(/no ip http server/).any?
$httpserver_failures.push(file)
out.puts "FAILED: does have http enabled"
else
$httpserver_passes.push(file)
out.puts "PASSED: does not have http enabled"
end
end
So I just need to add a line to also output the line as it's found. I just don't know the syntax.
Thanks