Commit adc4f1d2 authored by Ad Schellevis's avatar Ad Schellevis Committed by Franco Fichtner

(list_arp.py) only parse lease sections https://forum.opnsense.org/index.php?topic=4086.0

(cherry picked from commit feb11e59)
parent 62492872
......@@ -45,7 +45,7 @@ if __name__ == '__main__':
if os.path.isfile(dhcp_leases_filename):
leases = open(dhcp_leases_filename, 'r').read()
for lease in leases.split('}'):
if lease.find('{') > -1:
if lease.strip().find('lease') == 0 and lease.find('{') > -1:
dhcp_ipv4_address = lease.split('{')[0].split('lease')[1].strip()
if lease.find('client-hostname') > -1:
dhcp_leases[dhcp_ipv4_address] = {'hostname': lease.split('client-hostname')[1].strip()[1:-2]}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment