crowdsec/test/instance-db
mmetc ccf08e56d9
bats: no need for openssl, netcat; allow to prevent tests from running with a lock (#3016)
* bats: lock/unlock instance data; replace openssl w/ cfssl; update dep list

* concat pem without openssl :-/

* unused/unreachable code

* lint

* redundant {} (shellharden)
2024-05-16 10:58:00 +02:00

18 lines
390 B
Bash
Executable file

#!/usr/bin/env bash
#shellcheck disable=SC1007
THIS_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
cd "$THIS_DIR" || exit 1
# shellcheck disable=SC1091
. ./.environment.sh
./bin/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" "$@"