From ff3f3c49a5e84cd86637a4c7b7146326560b8d3d Mon Sep 17 00:00:00 2001 From: Valentin Lab Date: Tue, 15 Oct 2019 13:16:11 +0200 Subject: [PATCH] new: [pandachi-install] ``pgm`` allows overriding default PGUSER and PGHOST. --- bin/pandachi-install | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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