version 1.19, 2019/07/02 19:40:22
|
version 1.21, 2020/07/09 13:42:37
|
Line 181 sub firewall_open_port {
|
Line 181 sub firewall_open_port {
|
} |
} |
} |
} |
} else { |
} else { |
print "no key found in $iphost hash ref\n"; |
print "no key found in \$iphost hash ref.\n". |
|
"Domain Name Service (DNS) may not be available.\n". |
|
"If this LON-CAPA node is standalone, then you can fix this issue by modifying /etc/hosts.\n". |
|
"Use a text editor to add: IPaddress Hostname\n"; |
} |
} |
} else { |
} else { |
print "$iphost is not a reference to a hash\n"; |
print "\$iphost is not a reference to a hash\n"; |
} |
} |
if (@lond_port_curropen) { |
if (@lond_port_curropen) { |
unless (grep(/^\Q$port\E$/,@opened)) { |
unless (grep(/^\Q$port\E$/,@opened)) { |
Line 276 sub firewall_is_port_open {
|
Line 279 sub firewall_is_port_open {
|
# for other ports returns 1 if the firewall port is open, 0 if not. |
# for other ports returns 1 if the firewall port is open, 0 if not. |
# if firewalld is in use, checks for rich rules only. |
# if firewalld is in use, checks for rich rules only. |
my $count = 0; |
my $count = 0; |
|
# check if firewall is active or installed |
return $count if (! &firewall_is_active()); |
return $count if (! &firewall_is_active()); |
if ($firewalld) { |
if ($firewalld) { |
my $zone = &get_default_zone(); |
my $zone = &get_default_zone(); |
Line 307 sub firewall_is_port_open {
|
Line 311 sub firewall_is_port_open {
|
close(PIPE); |
close(PIPE); |
} |
} |
} |
} |
return $count; |
} elsif (($fw_chain =~ /^[\w-]+$/) && (open(PIPE,"$iptables -L $fw_chain -n |"))) { |
} |
|
return $count unless ($fw_chain !~ /^[\w-]+$/); |
|
if (open(PIPE,"$iptables -L $fw_chain -n |")) { |
|
# check if firewall is active or installed |
|
return if (! &firewall_is_active()); |
|
while(<PIPE>) { |
while(<PIPE>) { |
if ($port eq $lond_port) { |
if ($port eq $lond_port) { |
if (ref($iphost) eq 'HASH') { |
if (ref($iphost) eq 'HASH') { |