From 8617cbbb9e016748cb60fffccab13cfc7fc5ded9 Mon Sep 17 00:00:00 2001 From: Florin Grad Date: Mon, 22 Mar 2004 15:53:29 +0000 Subject: do not write the REDIRECT squid rules if one has only one NIC connected to the net zone --- perl-install/network/shorewall.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'perl-install/network') diff --git a/perl-install/network/shorewall.pm b/perl-install/network/shorewall.pm index 01ed2f422..06b0efa09 100644 --- a/perl-install/network/shorewall.pm +++ b/perl-install/network/shorewall.pm @@ -140,7 +140,7 @@ sub write { 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") { + 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" -- cgit v1.2.1