From 5f735112f2a8b070d4ec133fd37e2e6b97a6af38 Mon Sep 17 00:00:00 2001 From: Callan Bryant Date: Sat, 7 Mar 2020 14:36:14 +0000 Subject: [PATCH] use keepalive const in template --- add.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/add.go b/add.go index 7517329..93ee38c 100644 --- a/add.go +++ b/add.go @@ -3,6 +3,7 @@ package dsnet import ( "fmt" "os" + "time" "text/template" ) @@ -59,13 +60,14 @@ PresharedKey={{ .Peer.PresharedKey.Key }} Endpoint={{ .DsnetConfig.ExternalIP }}:{{ .DsnetConfig.ListenPort }} #AllowedIPs=0.0.0.0/0 AllowedIPs={{ .DsnetConfig.Network }} -PersistentKeepalive=21 +PersistentKeepalive={{ .Keepalive }} ` t := template.Must(template.New("peerConf").Parse(peerConf)) err := t.Execute(os.Stdout, map[string]interface{}{ "Peer": peer, "DsnetConfig": conf, + "Keepalive": time.Duration(KEEPALIVE).Seconds(), }) check(err) }