From c7645e5ce7d313573147910506594e43d70777bf Mon Sep 17 00:00:00 2001 From: Antonio Fernandez Date: Wed, 23 Dec 2020 00:14:28 -0500 Subject: [PATCH] Removed blank PostUp and PostDown Not every server config needs a PostUp or PostDown so I added an if statement to not include them if the values entered in the web interface are blank. --- wg_dashboard_backend/templates/server.j2 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wg_dashboard_backend/templates/server.j2 b/wg_dashboard_backend/templates/server.j2 index e542f3d..05a66c0 100644 --- a/wg_dashboard_backend/templates/server.j2 +++ b/wg_dashboard_backend/templates/server.j2 @@ -3,8 +3,12 @@ Address = {{ data.address }}/{{ data.subnet }}{%- if is_ipv6 -%},{{ data.v6_addr ListenPort = {{ data.listen_port }} PrivateKey = {{ data.private_key }} +{% if data.post_up or data.v6_post_up %} PostUp = {{ data.post_up }}{%- if is_ipv6 -%} {{ data.v6_post_up }}{%- endif %} +{%- endif %} +{% if data.post_down or data.v6_post_down %} PostDown = {{ data.post_down }}{%- if is_ipv6 -%} {{ data.v6_post_down }}{%- endif %} +{%- endif %} {% for peer in data.peers %} [Peer]