dnsleases improved

This commit is contained in:
Dirk Alders 2025-01-29 13:29:25 +01:00
parent b536b751cd
commit 1d30668b5a

View File

@ -1,6 +1,7 @@
#!/bin/python3
#
import subprocess
import sys
import time
class host(object):
@ -87,7 +88,22 @@ with open('/var/lib/misc/dnsmasq.leases', 'r') as fh:
if h.mac not in hl:
hl.append(h)
for vlan in [20, 30, 40, 50, 60, 90]:
print("Hosts in VLAN %d" % vlan)
VLANs = {
20: "Network Devices - Switch, AP, ...",
30: "Private VLAN",
40: "Smarthome with Internet",
50: "Smarthome no Internet",
60: "Guest VLAN",
}
try:
PRINT_LIST = [int(sys.argv[1]), ]
except (IndexError, ValueError) as e:
PRINT_LIST = VLANs.keys()
for vlan in PRINT_LIST:
print(f"Hosts in VLAN {vlan} - {VLANs.get(vlan, 'Unknown')}")
print(hl.vlan_list(vlan))
print()