You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1.0.0_01_create_db.sh 372B

123456789101112131415161718
  1. #! /usr/bin/env bash
  2. if [ "${POSTGRES_SLAVE_MODE}" == 1 ]
  3. then
  4. echo "Database is in slave mode. Exiting."
  5. exit 0
  6. fi
  7. if [ "${POSTGRES_USER}" != 'postgres' ]
  8. then
  9. psql <<-EOF
  10. CREATE USER "${POSTGRES_USER}" WITH SUPERUSER PASSWORD '${POSTGRES_PASSWORD}';
  11. EOF
  12. else
  13. psql <<-EOF
  14. ALTER USER "${POSTGRES_USER}" WITH SUPERUSER PASSWORD '${POSTGRES_PASSWORD}';
  15. EOF
  16. fi