diff --git a/config.go b/config.go index f156036..d3e5805 100644 --- a/config.go +++ b/config.go @@ -110,7 +110,7 @@ PrivateKey = {{ .PrivateKey | wgKey }} PublicKey = {{ .PublicKey | wgKey }} AllowedIPs = {{ range $i, $el := .AllowedIPs }}{{if $i}}, {{ end }}{{ $el }}{{ end }} {{- if .PresharedKey }}{{ "\n" }}PresharedKey = {{ .PresharedKey }}{{ end }} -{{- if .PersistentKeepaliveInterval }}{{ "\n" }}PersistentKeepaliveInterval = {{ .PersistentKeepaliveInterval | toSeconds }}{{ end }} +{{- if .PersistentKeepaliveInterval }}{{ "\n" }}PersistentKeepalive = {{ .PersistentKeepaliveInterval | toSeconds }}{{ end }} {{- if .Endpoint }}{{ "\n" }}Endpoint = {{ .Endpoint }}{{ end }} {{- end }} ` diff --git a/config_test.go b/config_test.go index 321838a..7f012ba 100644 --- a/config_test.go +++ b/config_test.go @@ -1,8 +1,9 @@ package wgquick import ( - "github.com/stretchr/testify/assert" "testing" + + "github.com/stretchr/testify/assert" ) var testConfigs = map[string]string{ @@ -47,6 +48,7 @@ PreDown = ip rule delete ipproto tcp dport 22 table 1234 [Peer] PublicKey = xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg= AllowedIPs = 0.0.0.0/0 +PersistentKeepalive = 25 `, }