#!/bin/sh # Write dhcpd ranges to dhcpd-snmp.conf DHCPD="/usr/local/etc/dhcpd.conf" DHSNMP="/usr/local/etc/dhcpd-snmp.conf" INDEX="0" DHPOOL=`cat ${DHCPD} | grep range | awk '{print $2"-"$3}' | cut -d";" -f1` for range in ${DHPOOL} do $((INDEX=INDEX+1)) echo "`echo "pool:" $INDEX", pool"$INDEX", "$range | \ sed 's/^.*(//'`" >> $DHSNMP done