mirror of
https://github.com/dehydrated-io/dehydrated.git
synced 2026-06-12 16:44:29 +02:00
make hook a command line parameter
This commit is contained in:
@@ -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