Closed Angel0ffDeath closed 2 years ago
Unfortunately, my host updated on Dec 27th, so I will have to wait about 30 days as well, so I look forward to hearing how it goes for you.
@Angel0ffDeath
Can you please post this Code in a Valid Code tag? I try to test but it's not working and give a lot of errors.
Due to some unknown reasons, code tag doesn't work correct. Will make the corrections in my fork @CrAzY-Tool Edit: The changes are here: https://github.com/Angel0ffDeath/noip-renew/blob/patch-3/noip-renew.py
Lines 119 to 129
To test it - run the script. It will make cronjob for confirmation. (6 days before expiration). After this cronjob runs, if everything is ok the new cronjob should be scheduled for after exactly 31 days. If not - something is wrong. Please use debug level 2 to have full log. Thanks in advance.
PS: If somethin is wrong, I will be able to make new test on Jan 24th, so give some feedback as soon as you have it...
Hi,
Code is now working here, thanks. I have to wait until my next renew period to give feedback.
@CrAzY-Tool Yeah... Unfortunately we should wait, but we will solve it. If something is wrong after that I will be able to test and benyjr also, so in all cases we will solve it.
Good News...Code is working perfect. Crondate is set to correct date now.
@CrAzY-Tool ok. Thanks. Will make pull request later today
If you run the script as cronjob - the script runs at specified time on calculated date which is correct, confirms the host(s), but doesn't create correct new cronjob for the next run.
Edit: Looking into the code: nr = min(next_renewal) - 6 today = date.today() + timedelta(days=nr) We always run the script 6 days before expiration date. And if you run the script 6 days before expiration the above will result in same day. Which leads to a new cronjob after 1 year.
Possible Fix - expiration days should be reread after host is confirmed:
Existing code: expiration_days = self.get_host_expiration_days(host, iteration) next_renewal.append(expiration_days) self.logger.log(f"{host_name} expires in {str(expiration_days)} days") if expiration_days <= 7: self.update_host(host_button, host_name) count += 1
Change to: expiration_days = self.get_host_expiration_days(host, iteration) if expiration_days <= 7: self.update_host(host_button, host_name) expiration_days = self.get_host_expiration_days(host, iteration) next_renewal.append(expiration_days) self.logger.log(f"{host_name} expires in {str(expiration_days)} days") count += 1 else: next_renewal.append(expiration_days) self.logger.log(f"{host_name} expires in {str(expiration_days)} days")
This fix should create directly new cronjob for the correct date.
@neothematrix @benyjr @peteakalad Unfortunately will be able to test this after 1 month. If someone can test it sooner will be good...