mirror of
https://github.com/gravitl/netmaker.git
synced 2024-11-11 10:10:46 +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 {
|
if peer.Endpoint != nil {
|
||||||
wireguard.SectionWithIndex(section_peers, i).Key("Endpoint").SetValue(peer.Endpoint.String())
|
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 {
|
if err := wireguard.SaveTo(file); err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in a new issue