#! /bin/bash if [ ! -s "$PGDATA/PG_VERSION" ]; then pg_basebackup -d "host=$MASTER_NODE password=$REPLICATION_PASSWORD port=5432 user=$REPLICATION_USER" -D ${PGDATA} -vP set -e cat > ${PGDATA}/recovery.conf <