#! /bin/bash

cd /usr/libexec/bacula/

PSQL_OPTS="-h ${DB_PORT_5432_TCP_ADDR} -U postgres"

./create_postgresql_database ${PSQL_OPTS}
./make_postgresql_tables ${PSQL_OPTS}
./grant_postgresql_privileges ${PSQL_OPTS}

#! /bin/bash

cd /usr/libexec/bacula/

PSQL_OPTS="-h ${DB_PORT_5432_TCP_ADDR} -U postgres"

export PGPASSWORD=${DB_ENV_POSTGRES_PASSWORD}

createuser ${PSQL_OPTS} -d -R bacula
./create_bacula_database ${PSQL_OPTS}
./make_bacula_tables  ${PSQL_OPTS}
./grant_bacula_privileges ${PSQL_OPTS}

Fix first run script, dpass password via env variable
Fix first run script, dpass password via env variable
