Re-add duplicate server check but do it properly this time

master
HimbeerserverDE 2022-05-03 08:06:07 +02:00
parent 4ce3bade10
commit 9a06c8f860
No known key found for this signature in database
GPG Key ID: A3D3E205DA0B0401
1 changed files with 7 additions and 5 deletions

View File

@ -256,15 +256,17 @@ func LoadConfig() error {
}
// Dynamic servers shouldn't be deleted silently.
DynLoop:
for name, srv := range oldConf.Servers {
if srv.dynamic {
if _, ok := config.Servers[name]; ok {
config = oldConf
return fmt.Errorf("duplicate server %s", name)
}
config.Servers[name] = srv
} else {
for name2 := range config.Servers {
if name == name2 {
continue DynLoop
}
if _, ok := config.Servers[name]; ok {
continue
}
for cc := range Clts() {