mirror of
https://github.com/dehydrated-io/dehydrated.git
synced 2026-01-11 22:30:44 +01:00
hook.sh reload services only once after at least one domain change #445
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ghost on GitHub (Dec 2, 2019).
Hello,
Currently, when we want to reload services that are dependent on certificates, we may use the hook script deploy_cert() function. Unfortunately, this means that if the script is renewing multiple certificates, the deploy_cert() function will be called once per domain and thus reload the services multiple times.
Would it be possible to change the exit_hook() function, so that its passed a status parameter that tells if there was at least one certificate that was created/updated, so that the reload of the services only happens once?
Thank you.
@jahir commented on GitHub (Dec 2, 2019):
Not saying it wouldn't be nice to have to this as a built-in feature, it's very easy to do it by yourself though. This is how I do it:
at the top of the hook script:
in
deploy_cert():in
exit_hook():@jobe1986 commented on GitHub (Dec 2, 2019):
I personally use the same method @jahir uses, though not exactly the same (the differences in my case are inconsequential, I still use flag files and test for the existence)
@ghost commented on GitHub (Mar 25, 2020):
no interest, closing