--- loncom/configuration/Firewall.pm 2009/07/03 17:59:01 1.3 +++ loncom/configuration/Firewall.pm 2009/07/06 00:07:19 1.4 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Firewall configuration to allow internal LON-CAPA communication between servers # -# $Id: Firewall.pm,v 1.3 2009/07/03 17:59:01 raeburn Exp $ +# $Id: Firewall.pm,v 1.4 2009/07/06 00:07:19 raeburn Exp $ # # The LearningOnline Network with CAPA # @@ -294,6 +294,7 @@ sub get_lond_port { } sub get_fw_chain { + my ($iptables) = @_; my $fw_chain = 'RH-Firewall-1-INPUT'; my $suse_config = "/etc/sysconfig/SuSEfirewall2"; if (-e $suse_config) { @@ -302,6 +303,9 @@ sub get_fw_chain { if (!-e '/etc/sysconfig/iptables') { print("Unable to find iptables file containing static definitions\n"); } + if ($iptables eq '') { + $iptables = &get_pathto_iptables(); + } my $count = `$iptables -L -n 2>/dev/null |grep $fw_chain |wc -l`; chomp($count); if (!$count) {