f13ec7f29a
Co-authored-by: Cursor <cursoragent@cursor.com>
14 lines
344 B
Bash
14 lines
344 B
Bash
#!/bin/bash
|
|
# Ожидание PostgreSQL (сокет или TCP 127.0.0.1:5432)
|
|
for i in $(seq 1 45); do
|
|
if pg_isready -q 2>/dev/null; then
|
|
exit 0
|
|
fi
|
|
if pg_isready -h 127.0.0.1 -p 5432 -q 2>/dev/null; then
|
|
exit 0
|
|
fi
|
|
sleep 1
|
|
done
|
|
echo "PostgreSQL недоступен (проверьте: systemctl status postgresql)"
|
|
exit 1
|