2022-03-18 09:13:12 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
#shellcheck disable=SC1007
|
|
|
|
THIS_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
|
2022-06-13 19:54:47 +00:00
|
|
|
cd "${THIS_DIR}" || exit 1
|
2022-10-04 13:58:10 +00:00
|
|
|
# shellcheck disable=SC1091
|
2022-03-21 14:51:05 +00:00
|
|
|
. ./.environment.sh
|
2022-03-18 09:13:12 +00:00
|
|
|
|
2022-10-04 13:58:10 +00:00
|
|
|
./bin/assert-crowdsec-not-running
|
2022-03-21 14:51:05 +00:00
|
|
|
|
|
|
|
backend_script="./lib/db/instance-${DB_BACKEND}"
|
|
|
|
|
2022-06-13 19:54:47 +00:00
|
|
|
if [[ ! -x "${backend_script}" ]]; then
|
|
|
|
echo "unknown database '${DB_BACKEND}'" >&2
|
2022-03-21 14:51:05 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2022-06-13 19:54:47 +00:00
|
|
|
exec "${backend_script}" "$@"
|