From d017ea17c82c4cd1f629d0154dce33939cba2fc8 Mon Sep 17 00:00:00 2001 From: Khanh Ngo Date: Thu, 23 Apr 2020 23:54:46 +0700 Subject: [PATCH] Don't write disabled client to wireguard config file --- templates/wg.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/wg.conf b/templates/wg.conf index 2bb3953..58e79ad 100644 --- a/templates/wg.conf +++ b/templates/wg.conf @@ -9,7 +9,7 @@ ListenPort = {{ .serverConfig.Interface.ListenPort }} PrivateKey = {{ .serverConfig.KeyPair.PrivateKey }} MTU = {{ .globalSettings.MTU }} -{{range .clientDataList}} +{{range .clientDataList}}{{if eq .Client.Enabled true}} # ID: {{ .Client.ID }} # Name: {{ .Client.Name }} # Email: {{ .Client.Email }} @@ -18,4 +18,4 @@ MTU = {{ .globalSettings.MTU }} [Peer] PublicKey = {{ .Client.PublicKey }} AllowedIPs = {{$first :=true}}{{range .Client.AllocatedIPs }}{{if $first}}{{$first = false}}{{else}},{{end}}{{.}}{{end}} -{{end}} +{{end}}{{end}}