diff options
Diffstat (limited to 'perl-install/network/shorewall.pm')
-rw-r--r-- | perl-install/network/shorewall.pm | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/perl-install/network/shorewall.pm b/perl-install/network/shorewall.pm index 94ce0abb1..687c73798 100644 --- a/perl-install/network/shorewall.pm +++ b/perl-install/network/shorewall.pm @@ -105,7 +105,7 @@ sub read { put_in_hash(\%conf, default_interfaces_silent($in)); } else { put_in_hash(\%conf, default_interfaces($in)); - }; + } $conf{net_interface} && \%conf; } @@ -138,14 +138,14 @@ sub write { if_(cat_("$::prefix$connect_file") =~ /pptp/, [ 'ACCEPT', 'fw', 'loc:10.0.0.138', 'tcp', '1723' ]), if_(cat_("$::prefix$connect_file") =~ /pptp/, [ 'ACCEPT', 'fw', 'loc:10.0.0.138', 'gre' ]), (map { - map_each { [ 'ACCEPT', $_, 'fw', $::a, join(',', @$::b), '-' ] } %ports_by_proto + map_each { [ 'ACCEPT', $_, 'fw', $::a, join(',', @$::b), '-' ] } %ports_by_proto; } ('net', if_($conf->{loc_interface}[0], 'loc'))), ); if (cat_("/etc/shorewall/rules") !~ /^\s*REDIRECT\s*loc\s*$squid_port\s+(\S+)/mg && $squid_port && -f "/var/run/squid.pid" && grep { /Loc/i } cat_("/etc/shorewall/zones")) { substInFile { s/#LAST LINE -- ADD YOUR ENTRIES BEFORE THIS ONE -- DO NOT REMOVE/REDIRECT\tloc\t$squid_port\ttcp\twww\t-\nACCEPT\tfw\tnet\ttcp\twww\n#LAST LINE -- ADD YOUR ENTRIES BEFORE THIS ONE -- DO NOT REMOVE/; - } "/etc/shorewall/rules" -}; + } "/etc/shorewall/rules"; +} set_config_file('masq', $conf->{masquerade} ? [ $conf->{net_interface}, $conf->{masquerade}{subnet} ] : (), ); |