mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-05-17 22:31:49 +02:00
Update run
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
#!/usr/bin/with-contenv bashio
|
#!/usr/bin/with-contenv bashio
|
||||||
|
# shellcheck shell=bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
CFG=/config/museum.yaml
|
CFG=/config/museum.yaml
|
||||||
@@ -11,14 +12,15 @@ if bashio::config.true 'USE_EXTERNAL_DB'; then
|
|||||||
DB_HOST="$(bashio::config 'DB_HOSTNAME')"
|
DB_HOST="$(bashio::config 'DB_HOSTNAME')"
|
||||||
DB_PORT="$(bashio::config 'DB_PORT')"
|
DB_PORT="$(bashio::config 'DB_PORT')"
|
||||||
DB_USER="$(bashio::config 'DB_USERNAME')"
|
DB_USER="$(bashio::config 'DB_USERNAME')"
|
||||||
bashio::log.info "Waiting for external Postgres at ${DB_HOST}:${DB_PORT}…"
|
bashio::log.info "Museum: waiting for external Postgres at ${DB_HOST}:${DB_PORT}..."
|
||||||
until pg_isready -q -h "${DB_HOST}" -p "${DB_PORT}" -U "${DB_USER}"; do
|
until pg_isready -q -h "${DB_HOST}" -p "${DB_PORT}" -U "${DB_USER}"; do
|
||||||
sleep 2
|
sleep 2
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
DB_USER="postgres"
|
# We'll connect as DB_USER (the one we created), not postgres superuser
|
||||||
bashio::log.info "Waiting for internal Postgres…"
|
DB_USER="$(bashio::config 'DB_USERNAME')"
|
||||||
until pg_isready -q -h localhost -p 5432 -U "${DB_USER}"; do
|
bashio::log.info "Museum: waiting for internal Postgres..."
|
||||||
|
until pg_isready -q -h 127.0.0.1 -p 5432 -U "${DB_USER}"; do
|
||||||
sleep 2
|
sleep 2
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user