summaryrefslogtreecommitdiffstats
path: root/lib/network/drakfirewall.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/network/drakfirewall.pm')
-rw-r--r--lib/network/drakfirewall.pm11
1 files changed, 2 insertions, 9 deletions
diff --git a/lib/network/drakfirewall.pm b/lib/network/drakfirewall.pm
index 8472b3f..c471e88 100644
--- a/lib/network/drakfirewall.pm
+++ b/lib/network/drakfirewall.pm
@@ -236,18 +236,11 @@ sub set_ifw {
);
}
- my $set_in_file = sub {
- my ($file, @list) = @_;
- substInFile {
- foreach my $l (@list) { s|^$l\n|| }
- $_ .= join("\n", @list) . "\n" if eof && $enabled;
- } "$::prefix/etc/shorewall/$file";
- };
substInFile {
undef $_ if $_ eq "INCLUDE /etc/ifw/rules", "iptables -I INPUT 2 -j Ifw";
} "$::prefix/etc/shorewall/start";
- $set_in_file->('start', "INCLUDE /etc/ifw/start", "INCLUDE /etc/ifw/rules", "iptables -I INPUT 1 -j Ifw");
- $set_in_file->('stop', "iptables -D INPUT -j Ifw", "INCLUDE /etc/ifw/stop");
+ network::shorewall::set_in_file('start', $enabled, "INCLUDE /etc/ifw/start", "INCLUDE /etc/ifw/rules", "iptables -I INPUT 1 -j Ifw");
+ network::shorewall::set_in_file('stop', $enabled, "iptables -D INPUT -j Ifw", "INCLUDE /etc/ifw/stop");
}
sub choose_watched_services {