estoday / wrtbwmon

Automatically exported from code.google.com/p/wrtbwmon
0 stars 0 forks source link

Getting host name automaticaly from dnsmasq #1

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Actually this is not a bug but a feature request.
Instead of setting the USERSFILE manually you could use the dnsmasq static
lease table to do this for you.

The attached patch checks if there is a USERFILE setted, if yes use it,
otherwise try to use the dnsmasq.conf from the default location on dd-wrt.
I don't know if this is the same on open-wrt or tomato so if it's not it
should try a list of locations.

Also the format of the dnsmasq.conf is different so instead of use = as
separator I'm using comma.

Few free to write to me if you want to discuss or ask something.

BTW nice job with the script! ;)

Original issue reported on code.google.com by seocam on 9 Jun 2009 at 11:23

Attachments:

GoogleCodeExporter commented 9 years ago
Hi,
On tomato the file is /etc/dnsmasq.conf, as well as on openwrt, but I can just 
try
all possible locations until I find it.

Your patch works well on entries like these :
dhcp-host=11:22:33:44:55:66,computername,192.168.1.3,24h
On tomato (and probably older versions of ddwrt too as I have seen these lines 
all
over the dd-wrt wiki) the init scripts create this instead :
dhcp-host=AB:CD:EF:11:22:33,192.168.1.10,24h
with the DNS names stored in /tmp/etc/hosts.dnsmasq.

I will merge your patch in the trunk though, it is a nice improvement. Thank 
you very
much !

Original comment by emmanuel...@gmail.com on 10 Jun 2009 at 11:39

GoogleCodeExporter commented 9 years ago

Original comment by emmanuel...@gmail.com on 11 Jan 2010 at 10:12