Skip to content

Commit

Permalink
Add PersistentKeepalive to generated wireguard config
Browse files Browse the repository at this point in the history
  • Loading branch information
mrkurt committed Dec 18, 2020
1 parent 29d5866 commit 05760df
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cmd/wireguard.go
Expand Up @@ -108,6 +108,7 @@ DNS = {{.Meta.DNS}}
PublicKey = {{.Peer.Pubkey}}
AllowedIPs = {{.Meta.AllowedIPs}}
Endpoint = {{.Peer.Endpointip}}:51820
PersistentKeepalive = 15
`
data := struct {
Expand Down Expand Up @@ -170,9 +171,9 @@ func runWireGuardCreate(ctx *cmdctx.CmdContext) error {

var name string
rx := regexp.MustCompile("^[a-zA-Z0-9\\-]+$")

for !rx.MatchString(name) {
if name != "" {
if name != "" {
fmt.Println("Name must consist solely of letters, numbers, and the dash character.")
}

Expand Down

0 comments on commit 05760df

Please sign in to comment.