mirror of
https://github.com/dehydrated-io/dehydrated.git
synced 2026-03-20 16:23:51 +01:00
make hook a command line parameter
This commit is contained in:
@@ -35,6 +35,7 @@ Parameters:
|
||||
--force (-x) Force renew of certificate even if it is longer valid than value in RENEW_DAYS
|
||||
--privkey (-p) path/to/key.pem Use specified private key instead of account key (useful for revocation)
|
||||
--config (-f) path/to/config.sh Use specified config file
|
||||
--hook (-k) path/to/hook.sh Use specified script for hooks
|
||||
```
|
||||
|
||||
### domains.txt
|
||||
|
||||
@@ -60,6 +60,10 @@ load_config() {
|
||||
|
||||
# Check BASEDIR and set default variables
|
||||
[[ -d "${BASEDIR}" ]] || _exiterr "BASEDIR does not exist: ${BASEDIR}"
|
||||
|
||||
if [[ -n "${PARAM_HOOK:-}" ]]; then
|
||||
HOOK="${PARAM_HOOK}"
|
||||
fi
|
||||
}
|
||||
|
||||
# Initialize system
|
||||
@@ -553,6 +557,14 @@ main() {
|
||||
CONFIG="${1}"
|
||||
;;
|
||||
|
||||
# PARAM_Usage: --hook (-k) path/to/hook.sh
|
||||
# PARAM_Description: Use specified script for hooks
|
||||
--hook|-k)
|
||||
shift 1
|
||||
check_parameters "${1:-}"
|
||||
PARAM_HOOK="${1}"
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Unknown parameter detected: ${1}" >&2
|
||||
echo >&2
|
||||
|
||||
Reference in New Issue
Block a user