postgres/rootfs/bin/db-password

9 lines
271 B
Bash
Executable file

#!/bin/sh
echo "local all all trust" > "$PGDATA/pg_hba.conf"
pg_ctl -D "$PGDATA" -o "-c listen_addresses='localhost'" -w start
psql --command "ALTER USER postgres WITH PASSWORD '${POSTGRES_PASSWORD}';"
pg_ctl -D "$PGDATA" -o "-c listen_addresses='localhost'" -w stop