Spaces:
Sleeping
Sleeping
Download init-postgres.sh from oonh/lmnr-test-1: direct link, hf CLI and curl.
- Browser
- Download file 546 Bytes
-
https://huggingface.co/spaces/oonh/lmnr-test-1/resolve/main/init-postgres.sh
- Command line
-
hf download hf://spaces/oonh/lmnr-test-1/init-postgres.sh
-
curl -L -o init-postgres.sh https://huggingface.co/spaces/oonh/lmnr-test-1/resolve/main/init-postgres.sh
546 Bytes
| 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';" | |