Skip to content

Instantly share code, notes, and snippets.

@cparedes
Created February 19, 2011 01:26
Show Gist options
  • Save cparedes/834731 to your computer and use it in GitHub Desktop.
Save cparedes/834731 to your computer and use it in GitHub Desktop.
not_if do
result = 1
if File.exists?(file)
iptables_file = IO.read(file).split("\n")
grepped_val = iptables_file
params.each_value do |val|
grepped_val = grepped_val.grep(/#{val}/)
result = 1 if grepped_val.empty?
end
result = 0
end
return result
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment