Omnibus-style container for Rebased and Soapbox
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.

16 lines
537 B

6 months ago
6 months ago
6 months ago
  1. #!/bin/sh
  2. set -e
  3. echo "-- Waiting for database..."
  4. while ! pg_isready -d $DATABASE_URL -t 1; do
  5. sleep 1s
  6. done
  7. COUNT=$(psql -p 5433 -q -c "select count(datname) from pg_catalog.pg_database where datname = 'pleroma'" -t -A | tr -d '\n');
  8. if [ "$COUNT" -lt "1" ]; then
  9. echo "Creating database..."
  10. psql -p 5433 -q -c "create user pleroma with encrypted password 'bleromer'"
  11. psql -p 5433 -q -c "create database pleroma with owner = 'pleroma'"
  12. psql -p 5433 -q -c "grant all privileges on database pleroma to pleroma"
  13. fi