rule.uc: fix redundant whitespace in rules without target
authorJo-Philipp Wich <jo@mein.io>
Wed, 31 Mar 2021 19:05:11 +0000 (21:05 +0200)
committerJo-Philipp Wich <jo@mein.io>
Wed, 31 Mar 2021 19:20:48 +0000 (21:20 +0200)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
root/usr/share/firewall4/templates/rule.uc

index 1f01d5f532502613384c1bdc81667fdf0ff6a2ac..0aae4806cefdd227e48ca62d1e9c500f2b016b10 100644 (file)
@@ -65,7 +65,7 @@
        counter {%+ endif -%}
 {%+ if (rule.log): -%}
        log prefix {{ fw4.quote(rule.log, true) }} {%+ endif -%}
-{% if (rule.target == "mark"): -%}
+{%+ if (rule.target == "mark"): -%}
        meta mark set {{
                (rule.set_xmark.mask == 0xFFFFFFFF)
                        ? fw4.hex(rule.set_xmark.mark)
                                        : (rule.set_xmark.mask == 0)
                                                ? 'mark xor ' + fw4.hex(rule.set_xmark.mark)
                                                : 'mark and ' + fw4.hex(~r.set_xmark.mask & 0xFFFFFFFF) + ' xor ' + fw4.hex(r.set_xmark.mark)
-       }}
-{%- elif (rule.target == "dscp"): -%}
-       {{ fw4.ipproto(rule.family) }} dscp set {{ fw4.hex(rule.set_dscp.dscp) }}
-{%- elif (rule.target == "notrack"): -%}
-       notrack
-{%- elif (rule.target == "helper"): -%}
-       ct helper set {{ fw4.quote(rule.set_helper.name, true) }}
-{%- elif (rule.jump_chain): -%}
-       jump {{ rule.jump_chain }}
-{%- else -%}
-       {{ rule.target }}
-{%- endif %} comment {{ fw4.quote("!fw4: " + rule.name, true) }}
+       }} {%+
+   elif (rule.target == "dscp"): -%}
+       {{ fw4.ipproto(rule.family) }} dscp set {{ fw4.hex(rule.set_dscp.dscp) }} {%+
+   elif (rule.target == "notrack"): -%}
+       notrack {%+
+   elif (rule.target == "helper"): -%}
+       ct helper set {{ fw4.quote(rule.set_helper.name, true) }} {%+
+   elif (rule.jump_chain): -%}
+       jump {{ rule.jump_chain }} {%+
+   elif (rule.target): -%}
+       {{ rule.target }} {%+
+   endif -%}
+comment {{ fw4.quote("!fw4: " + rule.name, true) }}