Robert Kaussow
3a91b11be2
Co-authored-by: Robert Kaussow <xoxys@rknet.org> Co-committed-by: Robert Kaussow <xoxys@rknet.org>
21 lines
607 B
Bash
Executable File
21 lines
607 B
Bash
Executable File
#!/usr/bin/env sh
|
|
|
|
# shellcheck disable=SC3040
|
|
set -eo pipefail
|
|
|
|
# shellcheck disable=SC1091
|
|
. /usr/local/lib/log.sh
|
|
|
|
/usr/local/bin/gomplate -o /app/.env -f /etc/templates/env.tmpl
|
|
|
|
if [ -n "$VAULTWARDEN_DATABASE_URL" ]; then
|
|
WAITFOR_HOST=$(/usr/local/bin/url-parser host --url "$VAULTWARDEN_DATABASE_URL")
|
|
WAITFOR_PORT=$(/usr/local/bin/url-parser port --url "$VAULTWARDEN_DATABASE_URL")
|
|
|
|
log_info "Wait for database server on '${WAITFOR_HOST}:${WAITFOR_PORT:-5432}'"
|
|
/usr/local/bin/wait-for "${WAITFOR_HOST}":"${WAITFOR_PORT:-5432}"
|
|
fi
|
|
|
|
log_info "Start Vaultwarden Server\n"
|
|
exec /app/vaultwarden
|