all-in-one/Containers/postgresql/healthcheck.sh
Simon L. c130cc0c0f adjust postgres healthcheck
Signed-off-by: Simon L. <szaimen@e.mail.de>
2024-12-05 16:30:47 +01:00

7 lines
296 B
Bash

#!/bin/bash
test -f "/mnt/data/backup-is-running" && exit 0
psql -d "postgresql://oc_$POSTGRES_USER:$POSTGRES_PASSWORD@127.0.0.1:11000/$POSTGRES_DB" -c "select now()" && exit 0
psql -d "postgresql://oc_$POSTGRES_USER:$POSTGRES_PASSWORD@127.0.0.1:5432/$POSTGRES_DB" -c "select now()" || exit 1