Convert script to use acme.sh hooks/commands and built-in --cron #22
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.
This PR largely just chops up the existing script into multiple files that can be used as hook/commands by acme.sh. The files are as follows:
setup.sh
script that does the initial issuing of the certificate. It also now spits out the configuration commands at the end. Once used, this file isn't needed anymore.pre-hook.sh
script that stops the built-in GUI, sets up the temporary lighttpd instance, and firewall rulespost-hook.sh
script which puts things back the way they werereloadcmd.sh
which combines the cert and key and copies the CA certWith these in place, it's possible to use acme.sh's built-in
--cron
option which doesn't do anything if the certificate doesn't need to be renewed, thus preventing unneeded restarts of the GUI/web server.I've tried to avoid hard-coding paths as much as possible in case anyone wanted to move the scripts to a different location.