From 6a6ceb5b1002e024957d72630475765f80d773ca Mon Sep 17 00:00:00 2001 From: Mike Dillon Date: Sat, 7 Mar 2015 22:18:12 -0800 Subject: [PATCH] [IMP] Allow PG* env vars to be set directly Makes it possible to use a non-linked Postgres container without having to fake $DB_* environment variables. --- 8.0/run.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/8.0/run.sh b/8.0/run.sh index 41dc889..f0f637c 100755 --- a/8.0/run.sh +++ b/8.0/run.sh @@ -1,10 +1,13 @@ #!/bin/bash +set -e + # set odoo database host, port, user and password -export PGHOST=$DB_PORT_5432_TCP_ADDR -export PGPORT=$DB_PORT_5432_TCP_PORT -export PGUSER=$DB_ENV_POSTGRES_USER -export PGPASSWORD=$DB_ENV_POSTGRES_PASSWORD +: ${PGHOST:=$DB_PORT_5432_TCP_ADDR} +: ${PGPORT:=$DB_PORT_5432_TCP_PORT} +: ${PGUSER:=${DB_ENV_POSTGRES_USER:='postgres'}} +: ${PGPASSWORD:=$DB_ENV_POSTGRES_PASSWORD} +export PGHOST PGPORT PGUSER PGPASSWORD [ "$1" != "--" ] && exec "$@"