Unverified Commit 5f300ad7 authored by Maciej Krüger's avatar Maciej Krüger
Browse files

networking/nftables: only delete our tables if flushRuleset is set to false

parent d5a08266
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -248,7 +248,11 @@ in
        RemainAfterExit = true;
        ExecStart = rulesScript;
        ExecReload = rulesScript;
        ExecStop = "${pkgs.nftables}/bin/nft flush ruleset";
        ExecStop = "${pkgs.nftables}/bin/nft ${
          if cfg.flushRuleset then "flush ruleset"
          else escapeShellArg (concatStringsSep "; " (
            mapAttrsToList (_: table: "delete table ${table.family} ${table.name}") enabledTables
          ))}";
      };
    };
  };