From dfc6df914b031c0b1de017248e50914013734b38 Mon Sep 17 00:00:00 2001 From: Jens Peter Secher Date: Mon, 4 Dec 2017 10:10:51 +0100 Subject: [PATCH] Fix script so that it works in current postgres container. --- create-multiple-postgresql-databases.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/create-multiple-postgresql-databases.sh b/create-multiple-postgresql-databases.sh index e883f80..aa665fa 100755 --- a/create-multiple-postgresql-databases.sh +++ b/create-multiple-postgresql-databases.sh @@ -10,10 +10,10 @@ function create_user_and_database() { CREATE USER $database; CREATE DATABASE $database; GRANT ALL PRIVILEGES ON DATABASE $database TO $database; - EOSQL +EOSQL } -if [ $POSTGRES_MULTIPLE_DATABASES ]; then +if [ -n "$POSTGRES_MULTIPLE_DATABASES" ]; then echo "Multiple database creation requested: $POSTGRES_MULTIPLE_DATABASES" for db in $(echo $POSTGRES_MULTIPLE_DATABASES | tr ',' ' '); do create_user_and_database $db