version 1.21, 2020/07/09 13:42:37
|
version 1.22, 2021/01/04 18:24:51
|
Line 119 sub firewall_open_port {
|
Line 119 sub firewall_open_port {
|
@lond_port_curropen); |
@lond_port_curropen); |
if (ref($iphost) eq 'HASH') { |
if (ref($iphost) eq 'HASH') { |
if (keys(%{$iphost}) > 0) { |
if (keys(%{$iphost}) > 0) { |
|
my $count = scalar(keys(%{$iphost})); |
|
if ($count > 1) { |
|
print "Please be patient. Checking $count IPs.\n"; |
|
} |
my %curropen; |
my %curropen; |
if ($firewalld) { |
if ($firewalld) { |
&firewall_close_anywhere($iptables,$zone,$port,$firewalld); |
&firewall_close_anywhere($iptables,$zone,$port,$firewalld); |
Line 132 sub firewall_open_port {
|
Line 136 sub firewall_open_port {
|
$lond_port,$iphost,\%curropen); |
$lond_port,$iphost,\%curropen); |
} |
} |
} |
} |
|
my $countok = 0; |
foreach my $key (keys(%{$iphost})) { |
foreach my $key (keys(%{$iphost})) { |
my $ip = ''; |
my $ip = ''; |
if ($key =~ /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/) { |
if ($key =~ /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/) { |
Line 179 sub firewall_open_port {
|
Line 184 sub firewall_open_port {
|
} |
} |
} |
} |
} |
} |
|
if ($count > 1) { |
|
$countok ++; |
|
print '.'; |
|
if ($countok%40 == 0) { |
|
print "\n"; |
|
} |
|
} |
|
} |
|
if ($count > 1) { |
|
if ($countok%40) { |
|
print "\n"; |
|
} |
} |
} |
} else { |
} else { |
print "no key found in \$iphost hash ref.\n". |
print "no key found in \$iphost hash ref.\n". |