mirror of https://github.com/zulip/zulip.git
postgres-init-db: Don't duplicate lines in .pgpass
(imported from commit 2a9d56a2aee2a7fcb2c12e4647bdfedabaee390b)
This commit is contained in:
parent
8767c33536
commit
655bacc06d
|
@ -33,7 +33,10 @@ ALTER ROLE $USERNAME SET search_path TO $SEARCH_PATH;
|
|||
EOF
|
||||
|
||||
umask go-rw
|
||||
echo "*:*:*:$USERNAME:$PASSWORD" >> ~/.pgpass
|
||||
PGPASS_LINE="*:*:*:$USERNAME:$PASSWORD"
|
||||
if ! $(grep -q "$PGPASS_LINE" ~/.pgpass); then
|
||||
echo $PGPASS_LINE >> ~/.pgpass
|
||||
fi
|
||||
chmod go-rw ~/.pgpass
|
||||
|
||||
psql -h localhost postgres $USERNAME <<EOF
|
||||
|
|
Loading…
Reference in New Issue