Sfoglia il codice sorgente

wg.conf: do not output list keys if they are a string

tags/v2.0
Maximilian Eschenbacher 6 anni fa
parent
commit
659aae2bed
1 ha cambiato i file con 5 aggiunte e 2 eliminazioni
  1. +5
    -2
      wireguard/files/wg.conf

+ 5
- 2
wireguard/files/wg.conf Vedi File

@@ -4,9 +4,12 @@
{%- endif -%}
{%- endmacro -%}
{%- macro output_list_if_set(object, lookup_key, output_key) -%}
{%- for item in object.get(lookup_key, []) -%}
{%- set l = object.get(lookup_key, []) -%}
{%- if l is not string -%}
{%- for item in l -%}
{{output_key}} = {{item}}
{%- endfor -%}
{%- endfor -%}
{%- endif -%}
{%- endmacro -%}
[Interface]
{{ output_list_if_set(interface, 'address', 'Address') }}

Loading…
Annulla
Salva