]> git.proxmox.com Git - pve-firewall.git/blobdiff - src/PVE/Firewall.pm
do not set persistent state if firewall is disabled
[pve-firewall.git] / src / PVE / Firewall.pm
index bf8f1931dfd425a300b2a059cc3f926997309362..d5d4950b6aaa4be45c796d37c084dc599452976c 100644 (file)
@@ -2875,18 +2875,14 @@ sub update {
        my $cluster_conf = load_clusterfw_conf();
        my $cluster_options = $cluster_conf->{options};
 
-       my $enable = !(defined($cluster_options->{enable}) && ($cluster_options->{enable} == 0));
+       my $enable = $cluster_options->{enable};
 
        my $status = read_pvefw_status();
 
        die "Firewall is disabled - cannot start\n" if !$enable && $start;
 
        if (!$enable) {
-           if ($status ne 'stopped') {
-               print "trying to stop firewall (firewall is disabled)\n" if $verbose;
-               PVE::Firewall::remove_pvefw_chains();
-               PVE::Firewall::save_pvefw_status('stopped');
-           }
+           PVE::Firewall::remove_pvefw_chains();
            print "Firewall disabled\n" if $verbose;
            return;
        }