mirror of
https://github.com/cwinfo/yggdrasil-go.git
synced 2024-11-09 01:10:28 +00:00
attempt to convert old multicast listen regexps into new struct format
This commit is contained in:
parent
2874ce1327
commit
a42b77db84
@ -96,6 +96,24 @@ func readConfig(log *log.Logger, useconf *bool, useconffile *string, normaliseco
|
||||
}
|
||||
}
|
||||
}
|
||||
if oldmc, ok := dat["MulticastInterfaces"]; ok {
|
||||
fmt.Println("DEBUG:", oldmc)
|
||||
if oldmcvals, ok := oldmc.([]interface{}); ok {
|
||||
var newmc []config.MulticastInterfaceConfig
|
||||
for _, oldmcval := range oldmcvals {
|
||||
if str, ok := oldmcval.(string); ok {
|
||||
newmc = append(newmc, config.MulticastInterfaceConfig{
|
||||
Regex: str,
|
||||
Incoming: true,
|
||||
Outgoing: true,
|
||||
})
|
||||
}
|
||||
}
|
||||
if newmc != nil {
|
||||
dat["MulticastInterfaces"] = newmc
|
||||
}
|
||||
}
|
||||
}
|
||||
// Sanitise the config
|
||||
confJson, err := json.Marshal(dat)
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user