Update you DynDNS automatically - HestiaPi/hestia-touch-openhab GitHub Wiki
getpublicip.sh does just that.
Stored with instructions here:
/home/pi/scripts/getpublicip.sh
You would need an account depending on the service you choose to use inside the script.