2020-02-01 17:34:59 +00:00
|
|
|
#!/usr/bin/env sh
|
2020-02-01 22:14:37 +00:00
|
|
|
|
2020-02-03 22:10:48 +00:00
|
|
|
set -eo
|
2020-02-01 17:34:59 +00:00
|
|
|
|
|
|
|
/usr/local/bin/gomplate -V -o /app/.env -f /etc/templates/env.tmpl
|
|
|
|
|
2020-02-03 22:10:48 +00:00
|
|
|
if [ "$BITWARDENRS_WAITFOR_ENABLED" = true ]
|
2020-02-01 17:34:59 +00:00
|
|
|
then
|
2020-02-03 22:10:48 +00:00
|
|
|
WAITFOR_HOST=$(url-parse host --url "$BITWARDENRS_DATABASE_URL")
|
|
|
|
WAITFOR_PORT=$(url-parse port --url "$BITWARDENRS_DATABASE_URL")
|
|
|
|
|
2020-02-01 22:14:37 +00:00
|
|
|
printf "Wait for database server ...\n"
|
2020-02-03 22:10:48 +00:00
|
|
|
/usr/local/bin/wait-for "${WAITFOR_HOST}":"${WAITFOR_PORT:-5432}"
|
2020-02-01 17:34:59 +00:00
|
|
|
fi
|
2020-02-01 18:09:53 +00:00
|
|
|
|
|
|
|
printf "Start Bitwarden Server ...\n"
|
|
|
|
exec /app/bitwarden_rs
|