lembregtse/gandi-dyndns — pull request #4 by adamsutton (2012-07-12 10:14:28+00:00)
Title: Re-write to add some more options

Hi,

Having made the minor tweaks last week, I decided to rewrite the script. I need to run this on a server inside my network (rather than on the router itself) and therefore I can't make it async, I have to periodically poll the IP (in case it changes) and update accordingly.

Using the script as provided was not ideal since it performed no checking so see whether updates needed to be made (i.e records already up to date) and every time it ran it created a new zone file version. If I was to run it frequently (lets say every few minutes) it would soon start to get a bit crazy :)

So I've made 2 significant changes:

1. It checks existing records against current IPs etc... And only updates if necessary.
2. It has an option to update the current zone file (off by default) rather than creating a new one each time.

I've also generally tidied up the code (sorry nothing wrong with yours, but I was doing it for my own reasons) and added some more debug and a test mode, etc...

Not sure whether you'll be interested in the updates but thought you might at least want to take a look.

Regards
Adam

P.S.
If you didn't spot it there was actually a bug in my optparse code, I'd forgotten to mark -4 and -6 as boolean options.