add hostsfile output in addition to statefile
a92c0a7 made the temporary state/leasefile hidden so that an atomic
change was made and dnsmasq only saw the new file on rename. A
misguided optimisation was made to only rename the temporary file if
something had changed. Unfortunately only address and hostnames were
considered in the change, lease durations were not.
As a result it was possible for LUCI which consumes the state/leasefile
to report DHCPv6 leases had expired when they had not.
Revert the optimisation so that the file rename occurs irrespective of
content change, this keeps LUCI reporting of state/lease expiry correct.
This leaves us back with hosts file/dnsmasq update problem. Solve this
by writing out a separate hosts file. Update this file using the
original IP/Hostname change logic that prompts calling the 'lease'
script.
odhcpd config now supports a string 'hostsfile' which defines the path
and name of the hosts file in an identical manner to 'leasefile'. A
state 'leasefile' must be defined IF a 'hostsfile' is also required.
eg.
leasefile '/tmp/odhcpdstate'
hostsfile '/tmp/hosts/odhcpdhosts'
Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>