nix/nixos-module/container/dhcp-server: fix dyndns and stats

This commit is contained in:
Astro 2023-10-24 01:17:41 +02:00
parent 9b39803076
commit 7722eb6243
2 changed files with 5 additions and 2 deletions

View File

@ -10,13 +10,15 @@ STDOUT.sync = true
loop do
seen = {}
count = 0
header = nil
now = Time.now.to_i
CSV::readlines("/var/lib/kea/kea-leases4.csv", headers: true).each do |rec|
h = rec.to_h
addr = h["hwaddr"]
next unless addr
last = h["expire"].to_i
elapsed = now - last
next if elapsed >= TIMEOUT
unless seen[addr]
count += 1

View File

@ -50,6 +50,7 @@ in
code = 6;
data = "172.20.73.8, 9.9.9.9";
} ];
ddns-qualifying-suffix = domainName;
});
match-client-id = false;