My public IPv4 is dynamic and my WAN interface is set to DHCP client. What I want to do is when the DHCP lease is renewed then a script is executed with a hit on my DNS server's API with the new IPv4 that has been assigned.
From what I understand it's a matter of adding a shell script in the corresponding folder in /etc/hotplug.d. But my first question is what is the corresponding folder for the DHCP client, which I believe is udhcpc? And how can I know what that folder should be?
Then I understand I need to match an action that would trigger a command. So in this case I guess the action would be renew but I'm not sure and again, I don't know how I can find this information.
And last, the command that I want to execute needs the new IPv4 address that has been assigned. I guess this is something I can find in the environment variables that are passed to the script but what is this variable called?
Thanks for the suggestions.
I am aware of the ddns package. But I'm really interested in the hotplug framework, I only lack a tiny bit of information to get it to work.
I could spot some reference to hotplug in the link but it is not very clear how it is used.