make hook a command line parameter

This commit is contained in:
Markus Germeier
2016-01-08 21:05:16 +01:00
parent a7934fe72d
commit ed27e013d1
2 changed files with 13 additions and 0 deletions

View File

@@ -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

View File

@@ -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