Skip to content

Commit

Permalink
Oops, wrong method name, and buggy firewall commands
Browse files Browse the repository at this point in the history
  • Loading branch information
swelljoe committed Jun 2, 2017
1 parent a7bf436 commit 5ea5d86
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions lib/Virtualmin/Config/Plugin/Firewalld.pm
Expand Up @@ -48,17 +48,18 @@ sub actions {

if (has_command('firewall-cmd')) {
foreach my $s (@services) {
logsystem("firewall-cmd --zone=public --add-service=${s}/tcp");
logsystem("firewall-cmd --zone=public --permanent --add-service=${s}/tcp");
$self->logsystem("firewall-cmd --zone=public --add-service=${s}");
$self->logsystem("firewall-cmd --zone=public --permanent --add-service=${s}");
}
foreach my $p (@tcpports) {
logsystem("firewall-cmd --zone=public --add-port=${p}/tcp");
logsystem("firewall-cmd --zone=public --permanent --add-port=${p}/tcp");
$self->logsystem("firewall-cmd --zone=public --add-port=${p}/tcp");
$self->logsystem("firewall-cmd --zone=public --permanent --add-port=${p}/tcp");
}
foreach my $p (@udpports) {
logsystem("firewall-cmd --zone=public --add-port=${p}/udp");
logsystem("firewall-cmd --zone=public --permanent --add-port=${p}/udp");
$self->logsystem("firewall-cmd --zone=public --add-port=${p}/udp");
$self->logsystem("firewall-cmd --zone=public --permanent --add-port=${p}/udp");
}
$self->logsystem("firewall-cmd --set-default-zone public");
}

$self->done(1); # OK!
Expand Down

0 comments on commit 5ea5d86

Please sign in to comment.