diff --git a/bin/pandachi-install b/bin/pandachi-install index aedfeb1..97d492e 100755 --- a/bin/pandachi-install +++ b/bin/pandachi-install @@ -72,11 +72,14 @@ pgpass="/srv/datastore/data/postgres/var/lib/postgresql/data/pgpass" } cp "\$pgpass" /root/.pgpass -PGUSER=postgres -PGHOST=\$(docker-ip | grep postgres | xargs echo | cut -f 3 -d " ") || { - echo "No local running postgres docker found." >&2 - exit 1 -} +PGUSER=\${PGUSER:-postgres} + +if [ -z "\$PGHOST" ]; then + PGHOST=\$(docker-ip | grep postgres | xargs echo | cut -f 3 -d " ") || { + echo "No local running postgres docker found." >&2 + exit 1 + } +fi export PGHOST PGUSER EOF