You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
759 B
Bash
18 lines
759 B
Bash
#!/bin/sh
|
|
|
|
# Check if the required variables are set
|
|
if [ -z "${KOMPASS_DB_HOST}" ]; then
|
|
echo "Error: KOMPASS_DB_HOST is not set. Exiting."
|
|
exit 1
|
|
fi
|
|
|
|
# Replace placeholders with environment variables in the SQL file
|
|
if [ -f /docker-entrypoint-initdb.d/create_users.sql ]; then
|
|
sed -i "s/KOMPASS_DB_PASSWORD/${KOMPASS_DB_PASSWORD}/g" /docker-entrypoint-initdb.d/create_users.sql
|
|
sed -i "s/KOMPASS_DB_PAM_PASSWORD/${KOMPASS_DB_PAM_PASSWORD}/g" /docker-entrypoint-initdb.d/create_users.sql
|
|
sed -i "s/KOMPASS_DB_QUERYMAIL_PASSWORD/${KOMPASS_DB_QUERYMAIL_PASSWORD}/g" /docker-entrypoint-initdb.d/create_users.sql
|
|
sed -i "s/KOMPASS_DB_HOST/${KOMPASS_DB_HOST}/g" /docker-entrypoint-initdb.d/create_users.sql
|
|
fi
|
|
|
|
echo "Update create_users.sql."
|