mirror of
https://github.com/dehydrated-io/dehydrated.git
synced 2026-07-08 05:55:18 +02: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 `--lock-suffix` option for allowing parallel execution
|
||||||
- Added `invalid_challenge` hook
|
- Added `invalid_challenge` hook
|
||||||
- Added `request_failure` hook
|
- Added `request_failure` hook
|
||||||
|
- Added `exit_hook` hook
|
||||||
|
|
||||||
## [0.3.1] - 2016-09-13
|
## [0.3.1] - 2016-09-13
|
||||||
## Changed
|
## Changed
|
||||||
|
|||||||
+2
-1
@@ -221,7 +221,7 @@ init_system() {
|
|||||||
_exiterr "Problem retrieving ACME/CA-URLs, check if your configured CA points to the directory entrypoint."
|
_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 some environment variables to be used in hook script
|
||||||
export WELLKNOWN BASEDIR CERTDIR CONFIG
|
export WELLKNOWN BASEDIR CERTDIR CONFIG COMMAND
|
||||||
|
|
||||||
# Checking for private key ...
|
# Checking for private key ...
|
||||||
register_new_key="no"
|
register_new_key="no"
|
||||||
@@ -822,6 +822,7 @@ command_sign_domains() {
|
|||||||
# remove temporary domains.txt file if used
|
# remove temporary domains.txt file if used
|
||||||
[[ -n "${PARAM_DOMAIN:-}" ]] && rm -f "${DOMAINS_TXT}"
|
[[ -n "${PARAM_DOMAIN:-}" ]] && rm -f "${DOMAINS_TXT}"
|
||||||
|
|
||||||
|
[[ -n "${HOOK}" ]] && "${HOOK}" "exit_hook"
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ invalid_challenge() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
request_failure() {
|
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
|
# 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
|
# 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...)
|
# 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="$1"; shift
|
||||||
"$HANDLER" "$@"
|
"$HANDLER" "$@"
|
||||||
|
|||||||
Reference in New Issue
Block a user