mirror of
https://github.com/dehydrated-io/dehydrated.git
synced 2026-03-20 08:14:00 +01:00
call exit_hook with error message (fixes #630)
This commit is contained in:
@@ -5,6 +5,7 @@ This file contains a log of major changes in dehydrated
|
|||||||
## Changed
|
## Changed
|
||||||
- OCSP refresh interval is now configurable
|
- OCSP refresh interval is now configurable
|
||||||
- Implemented POST-as-GET
|
- Implemented POST-as-GET
|
||||||
|
- Call exit_hook on errors (with error-message as first parameter)
|
||||||
|
|
||||||
## Added
|
## Added
|
||||||
- Initial support for tls-alpn-01 validation
|
- Initial support for tls-alpn-01 validation
|
||||||
|
|||||||
@@ -432,6 +432,7 @@ _sed() {
|
|||||||
# Print error message and exit with error
|
# Print error message and exit with error
|
||||||
_exiterr() {
|
_exiterr() {
|
||||||
echo "ERROR: ${1}" >&2
|
echo "ERROR: ${1}" >&2
|
||||||
|
[[ -n "${HOOK:-}" ]] && "${HOOK}" "exit_hook" "${1}" || true
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -178,10 +178,14 @@ startup_hook() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
exit_hook() {
|
exit_hook() {
|
||||||
|
local ERROR="${1:-}"
|
||||||
|
|
||||||
# This hook is called at the end of the cron command and can be used to
|
# This hook is called at the end of the cron command and can be used to
|
||||||
# do some final (cleanup or other) tasks.
|
# do some final (cleanup or other) tasks.
|
||||||
|
#
|
||||||
:
|
# Parameters:
|
||||||
|
# - ERROR
|
||||||
|
# Contains error message if dehydrated exits with error
|
||||||
}
|
}
|
||||||
|
|
||||||
HANDLER="$1"; shift
|
HANDLER="$1"; shift
|
||||||
|
|||||||
Reference in New Issue
Block a user