From 913f31378277b040253ca743c01dd5b7cccfce67 Mon Sep 17 00:00:00 2001 From: ES-Alexander Date: Thu, 18 Apr 2024 02:41:48 +1000 Subject: [PATCH] core: services: beacon: fix broken ethernet domain name config --- core/services/beacon/main.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/services/beacon/main.py b/core/services/beacon/main.py index 4c4fee9b84..63ac7099de 100755 --- a/core/services/beacon/main.py +++ b/core/services/beacon/main.py @@ -113,7 +113,12 @@ def set_hostname(self, hostname: str) -> None: for interface in self.manager.settings.interfaces: match InterfaceType.guess_from_name(interface.name): case InterfaceType.WIRED | InterfaceType.USB: - interface.domain_names = [hostname, self.DEFAULT_HOSTNAME] # let's keep our default just in case + interface.domain_names = [ + old_name.replace(self.DEFAULT_HOSTNAME, hostname) for old_name in interface.domain_names + ] + # Let's keep our default just in case + if self.DEFAULT_HOSTNAME not in interface.domain_names: + interface.domain_names.append(self.DEFAULT_HOSTNAME) case InterfaceType.WIFI: interface.domain_names = [f"{hostname}-wifi"] case InterfaceType.HOTSPOT: