Sha256: 8e99862602325f73ea969053e79457c5c0fc5c7652f4d1a3b59b4104132fa0d2

Contents?: true

Size: 498 Bytes

Versions: 1

Compression:

Stored size: 498 Bytes

Contents

module Shutter
	module IPTables
		class Iface
			def initialize( path, type )
				@type = type
				file = File.open("#{path}/iface.#{type.to_s}", "r")
				@content = file.read
			end

			def to_s
				@content
			end

			def to_ipt
				@rules = ""
				@content.each_line do |line|
					line = line.strip
					if line =~ /^[a-z].+$/
						@rules += send(:"#{@type.to_s}_ipt", line)
					end
				end
				@rules
			end

			def dmz_ipt( iface )
				"-A Dmz -i #{iface} -j ACCEPT\n"
			end
		end
	end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
shutter-0.0.1 lib/shutter/iptables/iface.rb