diff postgres/setupDatabase.sh @ 81:53671513b240

DEP-10: add timezone and locale settings. add java base image. add native APR for tomcat
author smith@nwoca.org
date Mon, 11 Apr 2016 17:46:42 -0400
parents 0cdc167e6319
children
line wrap: on
line diff
--- a/postgres/setupDatabase.sh	Fri Apr 08 21:40:03 2016 +0100
+++ b/postgres/setupDatabase.sh	Mon Apr 11 17:46:42 2016 -0400
@@ -1,11 +1,13 @@
 #!/bin/bash
 
 export PGUSER=postgres
-TEST=`psql <<- EOSQL
+result=`psql -t -A <<- EOSQL
    SELECT 1 FROM pg_database WHERE datname='$DB_NAME';
 EOSQL`
 
-if [[ $TEST == "1" ]]; then
+echo "checking for existing $DB_NAME ( $result ) "
+
+if [[ $result == "1" ]]; then
     echo "$DB_NAME exists. continuing startup."
     # database exists
     # $? is 0