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

Open to a PR for passing in parameters as args? #93

Open
qhoffman opened this issue Jul 15, 2024 · 0 comments
Open

Open to a PR for passing in parameters as args? #93

qhoffman opened this issue Jul 15, 2024 · 0 comments

Comments

@qhoffman
Copy link

@K0p1-Git would you consider a PR that allows to set parameters from command line arguments?

eg. if someone runs bash cloudflare-template.sh --zone_identifier 123456abddef it would set the zone_identifier variable accordingly.

Obviously this would be implemented in a completely non-breaking way that still allows for users to continue to define their parameters in the script, only using CLI arguments when given, and otherwise using the config at the top of the script.

I think this would have 2 benefits:

1 - Easier updating

When you release a new version, and someone pulls it, they have a conflict with their local script that they modified to contain their config info and the newly updated script. This would allow someone to keep their config outside of the script, so a quick git pull doesn't conflict or overwrite their local config.

2 - Simplifies use-cases with multiple domains.

A user no longer need to have 3 different copies of the script for 3 different domains, they can just have a single line for each domain containing all the config data in their crontab or service script or whatever which calls the newly independent ddns updater file. Multi-domain support seems to be one of the most requested features, and I think this allows people to solve 99% of the issue on their own.

Basically this allows for separation of a user's config and the execution code, while still keeping the script lightweight and easy to understand and maintain.

If this is something you might accept, I can create a PR -- should be less than 10 lines or so.

Thanks!

Ps. This script has been a lifesaver since Google sold their domain service to Squarespace (which has extremely limited DNS options -- Can't change TTL and definitely no Dynamic DNS support 👎 ) and I started migrating my domains to Cloudflare.

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

1 participant