dnsleases improved
This commit is contained in:
parent
b536b751cd
commit
1d30668b5a
20
dnsleases
20
dnsleases
@ -1,6 +1,7 @@
|
|||||||
#!/bin/python3
|
#!/bin/python3
|
||||||
#
|
#
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import sys
|
||||||
import time
|
import time
|
||||||
|
|
||||||
class host(object):
|
class host(object):
|
||||||
@ -87,7 +88,22 @@ with open('/var/lib/misc/dnsmasq.leases', 'r') as fh:
|
|||||||
if h.mac not in hl:
|
if h.mac not in hl:
|
||||||
hl.append(h)
|
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(hl.vlan_list(vlan))
|
||||||
print()
|
print()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user