lib/shutter/iptables.rb in shutter-0.2.4 vs lib/shutter/iptables.rb in shutter-0.2.5

- old
+ new

@@ -48,11 +48,11 @@ def clean @base = @base.gsub(/^#.*$/, "") @base = @base.gsub(/^$\n/, "") # Add a newline at the end - @base + "\n\n" + @base += "\n" end def read(file, filter=true) #puts "Reading: #{@path}/#{file}" lines = File.read("#{@path}/#{file}").split("\n") @@ -73,10 +73,11 @@ def save puts self.generate end - def restore + def restore(persist = false) + rules = self.generate IO.popen("#{iptables_restore}", "r+") do |iptr| iptr.puts self.generate ; iptr.close_write end end \ No newline at end of file