From b2787f168bcd3b58e00badb950d1ad8cf9e22b62 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Fri, 10 May 2024 14:25:53 +0100 Subject: [PATCH] unbound-dhcp-leases-bridge: Initialize at startup When the process starts, we will now load all static hosts and leases and reload Unbound to have a defined state to start with. Signed-off-by: Michael Tremer --- config/unbound/unbound-dhcp-leases-bridge | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/config/unbound/unbound-dhcp-leases-bridge b/config/unbound/unbound-dhcp-leases-bridge index d6b39bfc2b..99e5672b4d 100644 --- a/config/unbound/unbound-dhcp-leases-bridge +++ b/config/unbound/unbound-dhcp-leases-bridge @@ -98,6 +98,12 @@ class UnboundDHCPLeasesBridge(object): self.unbound = UnboundConfigWriter(unbound_leases_file) self.running = False + # Read all static hosts + self.hosts = self.read_static_hosts() + + # Unconditionally update all leases and reload Unbound + self.update_dhcp_leases() + def run(self): log.info("Unbound DHCP Leases Bridge started on %s" % self.leases_file) self.running = True -- 2.39.5