#!/bin/bash # Initialize pg_hba.conf for external connections set -e echo "Configuring PostgreSQL for external connections..." # Create custom pg_hba.conf that allows password authentication from all hosts cat > /var/lib/postgresql/pg_hba_custom.conf <> /var/lib/postgresql/data/pg_hba.conf echo "host all all ::/0 md5" >> /var/lib/postgresql/data/pg_hba.conf echo "PostgreSQL configured for external connections"