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