This repository has been archived on 2021-08-31. You can view files and clone it, but cannot push or open issues or pull requests.
mattermost/db/docker-entrypoint1.sh

30 lines
616 B
Bash
Raw Normal View History

2016-04-20 05:50:19 +02:00
#!/bin/bash
if [ "${1:0:1}" = '-' ]; then
set -- postgres "$@"
fi
if [ "$1" = 'postgres' ]; then
VARS=(AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY WALE_S3_PREFIX AWS_REGION)
for v in ${VARS[@]}; do
if [ "${!v}" = "" ]; then
echo "$v is required for Wal-E but not set. Skipping Wal-E setup."
. /docker-entrypoint.sh
exit
fi
done
umask u=rwx,g=rx,o=
mkdir -p /etc/wal-e.d/env
for v in ${VARS[@]}; do
echo "${!v}" > /etc/wal-e.d/env/$v
done
chown -R root:postgres /etc/wal-e.d
. /docker-entrypoint.sh
fi
exec "$@"