]> git.proxmox.com Git - pve-firewall.git/blobdiff - pvefw
allow to disable single rules, and add ability to add comments
[pve-firewall.git] / pvefw
diff --git a/pvefw b/pvefw
index 4370678570dca59386ded0a90828d28148d8428b..30be559f1feb309e541b9191a0b79311f17342ce 100755 (executable)
--- a/pvefw
+++ b/pvefw
@@ -41,7 +41,6 @@ __PACKAGE__->register_method ({
                description => "Verbose output.",
                type => "boolean",
                optional => 1,
-               default => 0,
            },
        },
     },
@@ -50,6 +49,11 @@ __PACKAGE__->register_method ({
     code => sub {
        my ($param) = @_;
 
+       my $rpcenv = PVE::RPCEnvironment::get();
+
+       $param->{verbose} = 1 
+           if !defined($param->{verbose}) && ($rpcenv->{type} eq 'cli');
+
        my $code = sub {
            my $ruleset = PVE::Firewall::compile();
            PVE::Firewall::get_ruleset_status($ruleset, 1) if $param->{verbose};
@@ -82,8 +86,8 @@ __PACKAGE__->register_method ({
        my ($param) = @_;
 
        my $code = sub {
-           PVE::Firewall::enable_bridge_firewall();
-           PVE::Firewall::compile_and_start($param->{verbose});
+           my $ruleset = PVE::Firewall::compile();
+           PVE::Firewall::apply_ruleset($ruleset, $param->{verbose});
        };
 
        PVE::Firewall::run_locked($code);