Przeglądaj źródła

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

tags/v2.0
Maximilian Eschenbacher 5 lat temu
rodzic
commit
659aae2bed
1 zmienionych plików z 5 dodań i 2 usunięć
  1. +5
    -2
      wireguard/files/wg.conf

+ 5
- 2
wireguard/files/wg.conf Wyświetl plik

{%- endif -%} {%- endif -%}
{%- endmacro -%} {%- endmacro -%}
{%- macro output_list_if_set(object, lookup_key, output_key) -%} {%- 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}} {{output_key}} = {{item}}
{%- endfor -%}
{%- endfor -%}
{%- endif -%}
{%- endmacro -%} {%- endmacro -%}
[Interface] [Interface]
{{ output_list_if_set(interface, 'address', 'Address') }} {{ output_list_if_set(interface, 'address', 'Address') }}

Ładowanie…
Anuluj
Zapisz