mirror of
https://github.com/gravitl/netmaker.git
synced 2025-02-26 17:15:23 +08:00
fix iface on update
This commit is contained in:
parent
894fd1f5bd
commit
551a592a71
1 changed files with 6 additions and 4 deletions
|
@ -435,12 +435,14 @@ func UpdateWgInterface(file, privateKey, nameserver string, node models.Node) er
|
||||||
}
|
}
|
||||||
wireguard.Section(section_interface).Key("PrivateKey").SetValue(privateKey)
|
wireguard.Section(section_interface).Key("PrivateKey").SetValue(privateKey)
|
||||||
wireguard.Section(section_interface).Key("ListenPort").SetValue(strconv.Itoa(int(node.ListenPort)))
|
wireguard.Section(section_interface).Key("ListenPort").SetValue(strconv.Itoa(int(node.ListenPort)))
|
||||||
if node.Address != "" {
|
addrString := node.Address
|
||||||
wireguard.Section(section_interface).Key("Address").SetValue(node.Address)
|
|
||||||
}
|
|
||||||
if node.Address6 != "" {
|
if node.Address6 != "" {
|
||||||
wireguard.Section(section_interface).Key("Address").SetValue(node.Address6)
|
if addrString != "" {
|
||||||
|
addrString += ","
|
||||||
|
}
|
||||||
|
addrString += node.Address6
|
||||||
}
|
}
|
||||||
|
wireguard.Section(section_interface).Key("Address").SetValue(addrString)
|
||||||
//if node.DNSOn == "yes" {
|
//if node.DNSOn == "yes" {
|
||||||
// wireguard.Section(section_interface).Key("DNS").SetValue(nameserver)
|
// wireguard.Section(section_interface).Key("DNS").SetValue(nameserver)
|
||||||
//}
|
//}
|
||||||
|
|
Loading…
Reference in a new issue