mirror of
https://github.com/dehydrated-io/dehydrated.git
synced 2026-03-23 01:29:07 +01:00
added exit_hook hook
This commit is contained in:
@@ -11,6 +11,7 @@ This file contains a log of major changes in dehydrated
|
||||
- Added `--lock-suffix` option for allowing parallel execution
|
||||
- Added `invalid_challenge` hook
|
||||
- Added `request_failure` hook
|
||||
- Added `exit_hook` hook
|
||||
|
||||
## [0.3.1] - 2016-09-13
|
||||
## Changed
|
||||
|
||||
@@ -221,7 +221,7 @@ init_system() {
|
||||
_exiterr "Problem retrieving ACME/CA-URLs, check if your configured CA points to the directory entrypoint."
|
||||
|
||||
# Export some environment variables to be used in hook script
|
||||
export WELLKNOWN BASEDIR CERTDIR CONFIG
|
||||
export WELLKNOWN BASEDIR CERTDIR CONFIG COMMAND
|
||||
|
||||
# Checking for private key ...
|
||||
register_new_key="no"
|
||||
@@ -822,6 +822,7 @@ command_sign_domains() {
|
||||
# remove temporary domains.txt file if used
|
||||
[[ -n "${PARAM_DOMAIN:-}" ]] && rm -f "${DOMAINS_TXT}"
|
||||
|
||||
[[ -n "${HOOK}" ]] && "${HOOK}" "exit_hook"
|
||||
exit 0
|
||||
}
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ invalid_challenge() {
|
||||
}
|
||||
|
||||
request_failure() {
|
||||
local STATUSCODE="${1}" REASON="${2}" REQTYPE=${3}
|
||||
local STATUSCODE="${1}" REASON="${2}" REQTYPE="${3}"
|
||||
|
||||
# This hook is called when a HTTP request fails (e.g., when the ACME
|
||||
# server is busy, returns an error, etc). It will be called upon any
|
||||
@@ -105,5 +105,12 @@ request_failure() {
|
||||
# The kind of request that was made (GET, POST...)
|
||||
}
|
||||
|
||||
exit_hook() {
|
||||
# This hook is called at the end of a dehydrated command and can be used
|
||||
# to do some final (cleanup or other) tasks.
|
||||
|
||||
:
|
||||
}
|
||||
|
||||
HANDLER="$1"; shift
|
||||
"$HANDLER" "$@"
|
||||
|
||||
Reference in New Issue
Block a user