diff options
-rwxr-xr-x | src/op_mode/firewall.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/op_mode/firewall.py b/src/op_mode/firewall.py index 411e0be20..aba6f2598 100755 --- a/src/op_mode/firewall.py +++ b/src/op_mode/firewall.py @@ -91,9 +91,6 @@ def get_nftables_details(family, hook, priority): return out def output_firewall_vertical(rules, headers): - if args.rule: - rules.pop() - for rule in rules: adjusted_rule = rule + [""] * (len(headers) - len(rule)) # account for different header length, like default-action transformed_rule = [[header, textwrap.fill(adjusted_rule[i].replace('\n', ' '), 100)] for i, header in enumerate(headers)] # create key-pair list from headers and rules lists; wrap at 100 char @@ -135,6 +132,9 @@ def output_firewall_name(family, hook, priority, firewall_conf, single_rule_id=N rows.append(row) if rows: + if args.rule: + rows.pop() + header = ['Rule', 'Description', 'Action', 'Protocol', 'Packets', 'Bytes', 'Conditions'] if args.detail: output_firewall_vertical(rows, header) |