瀏覽代碼

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

tags/v2.0
Maximilian Eschenbacher 5 年之前
父節點
當前提交
659aae2bed
共有 1 個檔案被更改,包括 5 行新增2 行删除
  1. +5
    -2
      wireguard/files/wg.conf

+ 5
- 2
wireguard/files/wg.conf 查看文件

@@ -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…
取消
儲存