View Single Post
Old 07-15-2024, 09:39 PM   #18
ajkessel
Connoisseur
ajkessel began at the beginning.
 
Posts: 76
Karma: 10
Join Date: Jul 2017
Location: Boston
Device: Kobo Libra 2
Quote:
Originally Posted by jgneff View Post
For what it's worth, a long time ago I had luck adding an exit hook to the DHCP response, as follows:

Code:
# /etc/dhcpcd.exit-hook - sets the host name from DHCP data
# In Ubuntu: /lib/dhcpcd/dhcpcd-hooks/30-hostname (dhcpcd5)
# Called by: /libexec/dhcpcd-run-hooks
if $if_up; then
    if [ -n "$new_host_name" ]; then
        hostname "$new_host_name"
    fi
fi
I wanted to set the host name as provided by my router in the DHCP response, but perhaps you could set the MAC address here instead.
Thanks. Does anyone know if the network/dhcp process flow for Kobo is documented somewhere? One concern I have with setting the MAC address there is that in order to force the MAC address, you need to bring the interface down first or you get an error.. and this hook seems to be one that is called when the interface is coming up? So is there a chance of an infinite loop?
ajkessel is offline   Reply With Quote