mirror of
https://github.com/crowdsecurity/crowdsec.git
synced 2025-05-11 04:15:54 +02:00
26 lines
617 B
Bash
Executable file
26 lines
617 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
set -eu
|
|
|
|
die() {
|
|
echo >&2 "$@"
|
|
exit 1
|
|
}
|
|
|
|
#shellcheck disable=SC1007
|
|
THIS_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
|
|
cd "$THIS_DIR" || exit 1
|
|
# shellcheck disable=SC1091
|
|
. ./.environment.sh
|
|
|
|
if [[ -f "$LOCAL_INIT_DIR/.lock" ]] && [[ "$1" != "unlock" ]]; then
|
|
die "init data is locked: are you doing some manual test? if so, please finish what you are doing, run 'instance-data unlock' and retry"
|
|
fi
|
|
|
|
backend_script="./lib/config/config-${CONFIG_BACKEND}"
|
|
|
|
if [[ ! -x "$backend_script" ]]; then
|
|
die "unknown config backend '${CONFIG_BACKEND}'"
|
|
fi
|
|
|
|
exec "$backend_script" "$@"
|