Python script to log dhcp leases
Posted by kiwinewt on 28 December, 2007Thought I would share this. It is called from DNSMasq in the dnsmasq.conf file: dhcp-script=/home/nate/logdhcp.py
enjoy
#!/usr/bin/env python
import sys, string, array
appendLine=1
if sys.argv[4]:
f=open(‘/home/nate/dhcplog’, ‘r’)
lineArray=f.readlines()
for line in f:
lineArray.append(line)
for line in lineArray:
[...]
