17 lines
395 B
Bash
17 lines
395 B
Bash
#!/bin/sh
|
|
set -eu
|
|
|
|
export PGPASSWORD="${POSTGRES_PASSWORD:-postgres}"
|
|
|
|
until pg_isready -h "${POSTGRES_HOST:-postgres}" -U "${POSTGRES_USER:-postgres}" -d "${POSTGRES_DB:-toir}"; do
|
|
sleep 2
|
|
done
|
|
|
|
if [ -f /seed/equipment-import.sql ]; then
|
|
psql \
|
|
-h "${POSTGRES_HOST:-postgres}" \
|
|
-U "${POSTGRES_USER:-postgres}" \
|
|
-d "${POSTGRES_DB:-toir}" \
|
|
-f /seed/equipment-import.sql
|
|
fi
|