Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-write to add some more options #4

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

adamsutton
Copy link
Collaborator

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.

@adamsutton
Copy link
Collaborator Author

Oops, hadn't realised you can't update the current zone, damn it.

Update zone option removed, though I might add it back in with a create new and delete current etc...

@lembregtse
Copy link
Owner

Hi there

Yeah I'm aware no checking was done whatsoever, therefor the "lazy" comment
in the script ;-).

I'm currently on an internship in Ethiopia so I did not have had the time
to test it extensivly that's why I probably missed the error.

I'll look at your changes when I've got time!

Kind regards

Eric Lembregts

On Thu, Jul 12, 2012 at 1:14 PM, Adam Sutton <
[email protected]

wrote:

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.

You can merge this Pull Request by running:

git pull https://github.com/adamsutton/gandi-dyndns master

Or you can view, comment on it, or merge it online at:

#4

-- Commit Summary --

  • Re-write of the gandi dyndns script to add some additional options and
    generally tidying things up.

-- File Changes --

M gandi-dyndns (353)

-- Patch Links --

https://github.com/lembregtse/gandi-dyndns/pull/4.patch
https://github.com/lembregtse/gandi-dyndns/pull/4.diff


Reply to this email directly or view it on GitHub:
#4

@lembregtse
Copy link
Owner

As I do not have the time, I added you as collaborator, feel free to use the repo.

@adamsutton
Copy link
Collaborator Author

No problem, sounds like you've got plenty on :)

I did the mods for myself as I needed something a bit different and your script was the first thing I came across so I nicked most of the basic code from there ;)

I thought it only right to make you aware of what I'd done in case it was of any use to you :)

Regards
Adam

@adamsutton
Copy link
Collaborator Author

I've submitted a fix directly for the bug I spotted, just in case you or anyone else wants to pull from your master.

I'll leave my code running on my machine for a few days before I merge the PR.

This ultimately killed my zone! probably because I exceeded the version
number limit. Took quite a long time though!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants