diff --git a/dist/rootfs/etc/openlan/switch/network/network.json.example b/dist/rootfs/etc/openlan/switch/network/network.json.example index f78d48f..a3d35e2 100755 --- a/dist/rootfs/etc/openlan/switch/network/network.json.example +++ b/dist/rootfs/etc/openlan/switch/network/network.json.example @@ -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" } ] }, diff --git a/pkg/config/openvpn.go b/pkg/config/openvpn.go index 9047f42..1fb2ebf 100755 --- a/pkg/config/openvpn.go +++ b/pkg/config/openvpn.go @@ -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...) } }