Resolve WAN IP and Update Dyndns host

I am looking for a script to help to update my dyndns hosts

I have two wan IPs which is provided by my ISP provider by DHCP. Normally they change very infrequently. However, I would like to know if I could use script to change the IP provided to the two wan ports and then update my dyndns hosts.