Open dannutu opened 4 weeks ago
ok, so it seems that hotplugd should catch all dhcp updates, which is good.
however I am still unsure why it can successfully execute some commands (e.g. touch /tmp/file
) but not other (e.g. logger -t hotplug.dhcp text
, or even /usr/bin/logger -t hotplug.dhcp text
). logger -t hotplug.dhcp text
works as expected from the cli.
one rabbit hole leading to another one... :)
Thanks a lot for this small script, it was exactly what I was looking for, with Autodiscovery as the cherry on top! :)
Sadly though I bumped into an issue: my Wi-Fi setup has the DHCP server running on the router, not on the AP (they are separate physical devices), so the /tmp/dhcp.leases file on the AP is empty. Do you have any idea how to fetch the hostnames for MAC addresses from the router when needed? I reckon I could change your script to scp the file between devices when needed but I feel there must be a more "elegant" solution. If I was aware of any "trigger" from Dnsmasq for managing the MAC addresses or updating the /tmp/dhcp.leases file I could run a script similar with yours to publish the new MAC-hostname associations as retained MQTT messages.
Thanks again!