#! /usr/bin/env bash if [ "${POSTGRES_SLAVE_MODE}" == 1 ] then echo "Database is in slave mode. Exiting." exit 0 fi if [ "${POSTGRES_DB}" != 'postgres' ] then psql <<-EOF CREATE DATABASE "${POSTGRES_DB}"; EOF fi