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
+12
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