fix: static clien for openvpn.

This commit is contained in:
Daniel Ding
2025-09-29 16:59:18 +08:00
parent d8140ddf08
commit ebb0a8e24e
2 changed files with 6 additions and 6 deletions

View File

@@ -14,9 +14,9 @@
],
"clients": [
{
"name": "hi",
"address": "172.32.195.233",
"netmask": "172.32.195.234"
"name": "hi@example",
"address": "172.32.195.234",
"netmask": "172.32.195.233"
}
]
},

View File

@@ -93,16 +93,16 @@ func (o *OpenVPN) Merge(obj *OpenVPN) {
if o.Cipher == "" {
o.Cipher = obj.Cipher
}
if o.Routes == nil || len(o.Routes) == 0 {
if len(o.Routes) == 0 {
o.Routes = append(o.Routes, obj.Routes...)
}
if o.Push == nil || len(o.Push) == 0 {
if len(o.Push) == 0 {
o.Push = append(o.Push, obj.Push...)
}
if o.Script == "" {
o.Script = o.AuthBin(obj)
}
if o.Clients == nil || len(o.Clients) == 0 {
if len(o.Clients) == 0 {
o.Clients = append(o.Clients, obj.Clients...)
}
}