Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

32 lines (20 sloc) 0.716 kB
dep 'iptables' do
requires 'iptables rules'
def script; '/etc/network/if-pre-up.d/iptables'; end
met? { script.p.exists? }
meet do
render_erb "iptables/iptables.erb", :to => script, :sudo => true
sudo 'chmod +x /etc/network/if-pre-up.d/iptables'
end
end
dep 'iptables rules' do
def rule_path; '/etc/iptables.up.rules'; end
met? { rule_path.p.exists? }
meet do
render_erb "iptables/iptables.up.rules.erb", :to => rule_path, :sudo => true
# Why the .bad? Because Babushka insists on adding a credit to every file - this
# prevents iptables from working.
sudo "sed -i '1d' #{rule_path}"
sudo '/sbin/iptables-restore < /etc/iptables.up.rules'
end
end
Jump to Line
Something went wrong with that request. Please try again.