mirror of
https://github.com/dehydrated-io/dehydrated.git
synced 2026-07-07 21:45:14 +02:00
added hook to run before cron command (fixes #371)
This commit is contained in:
@@ -889,6 +889,7 @@ command_account() {
|
|||||||
# Description: Sign/renew non-existent/changed/expiring certificates.
|
# Description: Sign/renew non-existent/changed/expiring certificates.
|
||||||
command_sign_domains() {
|
command_sign_domains() {
|
||||||
init_system
|
init_system
|
||||||
|
[[ -n "${HOOK}" ]] && "${HOOK}" "startup_hook"
|
||||||
|
|
||||||
if [[ -n "${PARAM_DOMAIN:-}" ]]; then
|
if [[ -n "${PARAM_DOMAIN:-}" ]]; then
|
||||||
DOMAINS_TXT="$(_mktemp)"
|
DOMAINS_TXT="$(_mktemp)"
|
||||||
|
|||||||
+10
-3
@@ -105,14 +105,21 @@ request_failure() {
|
|||||||
# The kind of request that was made (GET, POST...)
|
# The kind of request that was made (GET, POST...)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
startup_hook() {
|
||||||
|
# This hook is called before the cron command to do some initial tasks
|
||||||
|
# (e.g. starting a webserver).
|
||||||
|
|
||||||
|
:
|
||||||
|
}
|
||||||
|
|
||||||
exit_hook() {
|
exit_hook() {
|
||||||
# This hook is called at the end of a dehydrated command and can be used
|
# This hook is called at the end of the cron command and can be used to
|
||||||
# to do some final (cleanup or other) tasks.
|
# do some final (cleanup or other) tasks.
|
||||||
|
|
||||||
:
|
:
|
||||||
}
|
}
|
||||||
|
|
||||||
HANDLER="$1"; shift
|
HANDLER="$1"; shift
|
||||||
if [[ "${HANDLER}" =~ ^(deploy_challenge|clean_challenge|deploy_cert|unchanged_cert|invalid_challenge|request_failure|exit_hook)$ ]]; then
|
if [[ "${HANDLER}" =~ ^(deploy_challenge|clean_challenge|deploy_cert|unchanged_cert|invalid_challenge|request_failure|startup_hook|exit_hook)$ ]]; then
|
||||||
"$HANDLER" "$@"
|
"$HANDLER" "$@"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user