From bbb35d72094ddb912c1ff5a660bf9fe36aee34b9 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Wed, 7 Aug 2019 10:52:19 +0100 Subject: [PATCH] Transform Listen statement to new format if needed --- cmd/yggdrasil/main.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd/yggdrasil/main.go b/cmd/yggdrasil/main.go index 129b01d5..ee8ebe8e 100644 --- a/cmd/yggdrasil/main.go +++ b/cmd/yggdrasil/main.go @@ -74,6 +74,12 @@ func readConfig(useconf *bool, useconffile *string, normaliseconf *bool) *config if err := hjson.Unmarshal(conf, &dat); err != nil { panic(err) } + // Check for fields that have changed type recently, e.g. the Listen config + // option is now a []string rather than a string + if listen, ok := dat["Listen"].(string); ok { + dat["Listen"] = []string{listen} + } + // Sanitise the config confJson, err := json.Marshal(dat) if err != nil { panic(err)