diff options
Diffstat (limited to 'postgresql-config/src/stage/opt/app/postgresql-config/etc/gen-pgpass')
-rw-r--r-- | postgresql-config/src/stage/opt/app/postgresql-config/etc/gen-pgpass | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/postgresql-config/src/stage/opt/app/postgresql-config/etc/gen-pgpass b/postgresql-config/src/stage/opt/app/postgresql-config/etc/gen-pgpass index ca99a0f..3ea9fa1 100644 --- a/postgresql-config/src/stage/opt/app/postgresql-config/etc/gen-pgpass +++ b/postgresql-config/src/stage/opt/app/postgresql-config/etc/gen-pgpass @@ -17,9 +17,10 @@ postgrespswd=$( ${INSTALL_ROOT}/opt/app/cdf/bin/getpropvalue -x -n postgres ) repmgrpswd=$( ${INSTALL_ROOT}/opt/app/cdf/bin/getpropvalue -x -n repmgr ) umask 077 -if [ -f ~postgres/.pgpaas ] +pswdfile=~postgres/.pgpass +if [ -f $pswdfile ] then - ed ~postgres/.pgpaas <<-EOF + ed $pswdfile <<-EOF H g/:postgres:/d g/:repmgr:/d @@ -28,6 +29,6 @@ then EOF fi -echo "*:*:*:postgres:$postgrespswd" >> ~postgres/.pgpass -echo "*:*:*:repmgr:$repmgrpswd" >> ~postgres/.pgpass -chmod go-rwx ~postgres/.pgpass +echo "*:*:*:postgres:$postgrespswd" >> $pswdfile +echo "*:*:*:repmgr:$repmgrpswd" >> $pswdfile +chmod 600 $pswdfile |