check 518 B

12345678910111213141516171819
  1. #!/command/with-contenv /bin/bash
  2. # shellcheck shell=bash
  3. SCRIPT_ROOT=/etc/s6-overlay/scripts
  4. source "$SCRIPT_ROOT/base.sh"
  5. # The config should be ready before starting
  6. if [ -f "$GPUSTACK_POSTGRES_CONFIG" ]; then
  7. source "$GPUSTACK_POSTGRES_CONFIG"
  8. fi
  9. source "$SCRIPT_ROOT/default-variables.sh"
  10. echo "[INFO] Checking Postgres readiness."
  11. if gosu postgres pg_isready -p "$EMBEDDED_DATABASE_PORT" -q; then
  12. echo "[INFO] Postgres is ready."
  13. exit 0
  14. else
  15. echo "[ERROR] Postgres is not ready."
  16. exit 1
  17. fi