lib/shutter/iptables/jail.rb in shutter-0.0.2 vs lib/shutter/iptables/jail.rb in shutter-0.0.3
- old
+ new
@@ -14,10 +14,10 @@
end
def jail_rules
jail = `/sbin/iptables-save | grep "^-A Jail"`
lines = jail.split('\n')
- unless lines != [] && lines[-1] == "-A Jail -j RETURN\n"
+ unless lines.last =~ /-A Jail -j RETURN/
jail += "-A Jail -j RETURN\n"
end
jail
end
end
\ No newline at end of file