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

Error in for loop #27

Open
madman9999 opened this issue Feb 3, 2021 · 3 comments
Open

Error in for loop #27

madman9999 opened this issue Feb 3, 2021 · 3 comments

Comments

@madman9999
Copy link

There is an error when you have more than one domain (DNSIDsv4) )to be updated. Only the first ID will be updated, all other will be ignored, because the variable old.ipv4 is updated inside the "for loop", which causes that in the next loop the old.ipv4==new.ipv4.

So please remove line 133 (echo $NEWIPv4 > old.ipv4). I think the same apply for IPv6, but I don't use it.

I put at the end of the script the following lines and it works like this:

if [ ! "$OLDIPv4" == "$NEWIPv4" ]; then echo $NEWIPv4 > old.ipv4 log "IP Address updated to $NEWIPv4" log "###################################################" fi

@alfschauer
Copy link

I can confirm: Issue still exists, second IDs won't be updated. You should adapt your script, maybe in the way madman9999 suggested.

@Strubbl
Copy link
Contributor

Strubbl commented Oct 29, 2021

There are now three solutions to this problem, see #23, #25 and #28

@gehaxelt
Copy link
Owner

I merged #28, so this should fix the issue?

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

No branches or pull requests

4 participants