summaryrefslogtreecommitdiff
path: root/sandcastle/images/postgres/init.sh
blob: d0cdacff5da5bc6a7dd0aa1df7e2af3ae4fb6abe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/bash

set -eu

# FIXME: use taler-config.
CUSTOM_PASSWORD=$(grep ^db-password < /config/deployment.conf | awk -F= '{print $2}' | tr -d "[:space:]")
if test -z "${CUSTOM_PASSWORD}"; then
  echo ERROR: database password empty.
fi
echo "ALTER ROLE root WITH PASSWORD '"${CUSTOM_PASSWORD}"';" | psql -U root
createdb -U root -O root taler
echo "ALTER SYSTEM SET logging_collector TO 'true';" | psql -U root
echo "ALTER SYSTEM SET log_directory TO '/logs';" | psql -U root
echo "ALTER SYSTEM SET log_filename TO 'postgres-%Y-%m-%d.log';" | psql -U root
pg_ctl restart