summaryrefslogtreecommitdiffstats
path: root/lib/network/shorewall.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/network/shorewall.pm')
-rw-r--r--lib/network/shorewall.pm8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/network/shorewall.pm b/lib/network/shorewall.pm
index 0361eb8..a93af5d 100644
--- a/lib/network/shorewall.pm
+++ b/lib/network/shorewall.pm
@@ -36,6 +36,14 @@ sub get_config_file {
map { [ split ' ' ] } grep { !/^#/ } cat_("$::prefix${shorewall_root}/$file");
}
+sub set_in_file {
+ my ($file, $enabled, @list) = @_;
+ substInFile {
+ foreach my $l (@list) { s|^$l\n|| }
+ $_ .= join("\n", @list) . "\n" if eof && $enabled;
+ } "$::prefix/etc/shorewall/$file";
+}
+
sub dev_to_shorewall {
my ($dev) = @_;
$dev =~ /^ippp/ && "ippp+" ||