Feature/email notifications #6
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This pull request introduces significant improvements to the DDNS runner script's reliability and updates the project documentation to reflect all current functionality.
The primary fix addresses a critical bug where the
run_ddns.shscript failed to correctly capture the Python script's exit code, leading to incorrect notification behavior. TheREADME.mdhas also been completely overhauled for clarity, accuracy, and completeness, ensuring all features like notifications and exit codes are properly documented.Key Changes
Bug Fixes
run_ddns.sh: The script now correctly captures the true exit code fromddns.py. Previously, it would always see an exit code of0due to an|| trueconstruct, causing notifications to be sent even when the IP was already up-to-date (exit code7). This is now fixed by temporarily disablingset -eand capturing$?directly after the script execution.Enhancements & Documentation
README.mdOverhaul: TheREADME.mdhas been rewritten to be more user-friendly and to serve as a complete reference for the script's features.--smtp,--username, etc.).ddns.pyand its impact on notifications.requirements.txt: A formalrequirements.txtfile has been added. This aligns with the installation logic already present inrun_ddns.shand makes dependency management explicit.How to Test
Verify the Exit Code Fix:
DDNS script finished with exit code 7andIP address is already up-to-date. No notification will be sent.No email should be sent.Verify Success Notification:
1.2.3.4).DDNS script finished with exit code 0, and you should receive a "✅ DDNS Update Successful" email.Review the
README.md:README.mdto ensure the instructions are clear, the tables are accurate, and all features are well-documented.Related Files
run_ddns.shREADME.mdrequirements.txt