File size: 546 Bytes
417cda0
01aa009
5f9a9a8
01aa009
 
 
e6d9816
 
 
 
 
 
01aa009
 
e6d9816
 
 
 
 
5f9a9a8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#! /bin/bash

pg_ctlcluster 15 main start

# Wait for PostgreSQL to be ready
echo "Waiting for PostgreSQL to be ready..."
attempts=0
max_attempts=30
until pg_isready -h localhost || [ $attempts -ge $max_attempts ]; do
  echo "Waiting for PostgreSQL to be ready... (attempt $((attempts + 1))/$max_attempts)"
  attempts=$((attempts + 1))
  sleep 1
done

if [ $attempts -ge $max_attempts ]; then
  echo "Error: PostgreSQL failed to start after $max_attempts attempts"
  exit 1
fi

psql -c "ALTER USER postgres WITH PASSWORD 'postgres_passwordabc';"