From fde986fa0e4a8cbf70d80a33b8854e340faf6374 Mon Sep 17 00:00:00 2001 From: vadym Date: Tue, 13 Dec 2022 14:40:12 +0200 Subject: [PATCH] added httpaddress and wwwroot command line check and do not overwrite if it's empty --- cmd/mesh/main.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/cmd/mesh/main.go b/cmd/mesh/main.go index 49af5ea2..008e0245 100644 --- a/cmd/mesh/main.go +++ b/cmd/mesh/main.go @@ -294,8 +294,12 @@ func run(args yggArgs, ctx context.Context) { return } //override httpaddress and wwwroot parameters in cfg - cfg.HttpAddress = args.httpaddress - cfg.WwwRoot = args.wwwroot + if len(args.httpaddress) > 0 { + cfg.HttpAddress = args.httpaddress + } + if len(args.wwwroot) > 0 { + cfg.WwwRoot = args.wwwroot + } // Setup the RiV-mesh node itself. { @@ -349,10 +353,10 @@ func run(args yggArgs, ctx context.Context) { options := []multicast.SetupOption{} for _, intf := range cfg.MulticastInterfaces { options = append(options, multicast.MulticastInterface{ - Regex: regexp.MustCompile(intf.Regex), - Beacon: intf.Beacon, - Listen: intf.Listen, - Port: intf.Port, + Regex: regexp.MustCompile(intf.Regex), + Beacon: intf.Beacon, + Listen: intf.Listen, + Port: intf.Port, Priority: uint8(intf.Priority), }) }