mirror of
https://github.com/gravitl/netmaker.git
synced 2025-02-26 17:15:23 +08:00
write persistent keepalive to wg.conf file
This commit is contained in:
parent
799f32c664
commit
1a00f8377e
1 changed files with 3 additions and 0 deletions
|
@ -379,6 +379,9 @@ func UpdateWgPeers(wgInterface string, peers []wgtypes.PeerConfig) error {
|
|||
if peer.Endpoint != nil {
|
||||
wireguard.SectionWithIndex(section_peers, i).Key("Endpoint").SetValue(peer.Endpoint.String())
|
||||
}
|
||||
if peer.PersistentKeepaliveInterval != nil && peer.PersistentKeepaliveInterval.Seconds() != 0 {
|
||||
wireguard.SectionWithIndex(section_peers, i).Key("PersistentKeepalive").SetValue(strconv.FormatInt((int64)(peer.PersistentKeepaliveInterval.Seconds()), 10))
|
||||
}
|
||||
}
|
||||
if err := wireguard.SaveTo(file); err != nil {
|
||||
return err
|
||||
|
|
Loading…
Reference in a new issue