mirror of
https://github.com/dehydrated-io/dehydrated.git
synced 2026-07-08 14:05:25 +02: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
|
--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)
|
--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
|
--config (-f) path/to/config.sh Use specified config file
|
||||||
|
--hook (-k) path/to/hook.sh Use specified script for hooks
|
||||||
```
|
```
|
||||||
|
|
||||||
### domains.txt
|
### domains.txt
|
||||||
|
|||||||
@@ -60,6 +60,10 @@ load_config() {
|
|||||||
|
|
||||||
# Check BASEDIR and set default variables
|
# Check BASEDIR and set default variables
|
||||||
[[ -d "${BASEDIR}" ]] || _exiterr "BASEDIR does not exist: ${BASEDIR}"
|
[[ -d "${BASEDIR}" ]] || _exiterr "BASEDIR does not exist: ${BASEDIR}"
|
||||||
|
|
||||||
|
if [[ -n "${PARAM_HOOK:-}" ]]; then
|
||||||
|
HOOK="${PARAM_HOOK}"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Initialize system
|
# Initialize system
|
||||||
@@ -553,6 +557,14 @@ main() {
|
|||||||
CONFIG="${1}"
|
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 "Unknown parameter detected: ${1}" >&2
|
||||||
echo >&2
|
echo >&2
|
||||||
|
|||||||
Reference in New Issue
Block a user