how to count IPs in use

David Forrest drf at maplepark.com
Wed Oct 7 16:00:51 UTC 2009


On Wed, 7 Oct 2009, John Hascall wrote:

>
>> David W. Hankins wrote:
>>> dhcpstatus is cool but when I'm in CLI, I often just "Control-R" and
>>> find this in my bash history;
>>>
>>>   awk '/^lease / { curlease = $2; } /^  binding state/ { lstates[curlease]
> = $3; } END { for (curl in lstates) { tstates[lstates[curl]]++; } for (curs in
> tstates) { print curs, tstates[curs]; } }' /var/db/dhcpd.leases
>
> If only there were a way to file away these sorts of shell scripts.... :)

I cut this out of the email, pasted it into /usr/local/sbin/leases, and 
made it executable.


-- 
David Forrest
St. Louis, Missouri



More information about the dhcp-users mailing list