123456789101112131415161718 |
- #! /usr/bin/env bash
-
- if [ "${POSTGRES_SLAVE_MODE}" == 1 ]
- then
- echo "Database is in slave mode. Exiting."
- exit 0
- fi
-
- if [ "${POSTGRES_USER}" != 'postgres' ]
- then
- psql <<-EOF
- CREATE USER "${POSTGRES_USER}" WITH SUPERUSER PASSWORD '${POSTGRES_PASSWORD}';
- EOF
- else
- psql <<-EOF
- ALTER USER "${POSTGRES_USER}" WITH SUPERUSER PASSWORD '${POSTGRES_PASSWORD}';
- EOF
- fi
|