mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-10 17:46:00 +02:00
Update 99-run.sh
This commit is contained in:
@@ -9,12 +9,11 @@ mkdir -p /config/minio-data
|
|||||||
mkdir -p /config/postgres-data
|
mkdir -p /config/postgres-data
|
||||||
mkdir -p /config/scripts/compose
|
mkdir -p /config/scripts/compose
|
||||||
|
|
||||||
bashio::log.info "Starting services"
|
|
||||||
|
|
||||||
################
|
################
|
||||||
# Run services #
|
# Run services #
|
||||||
################
|
################
|
||||||
|
|
||||||
|
bashio::log.info "Starting services"
|
||||||
for dir in /etc/services.d/*; do
|
for dir in /etc/services.d/*; do
|
||||||
# Check if the directory contains a 'run' file
|
# Check if the directory contains a 'run' file
|
||||||
if [ -f "$dir/run" ]; then
|
if [ -f "$dir/run" ]; then
|
||||||
@@ -30,16 +29,19 @@ done
|
|||||||
# Internal db bootstrap #
|
# Internal db bootstrap #
|
||||||
#########################
|
#########################
|
||||||
|
|
||||||
|
#Default values for internal
|
||||||
|
DB_NAME="ente_db"
|
||||||
|
DB_USER="pguser"
|
||||||
|
DB_PASS="ente"
|
||||||
|
|
||||||
if bashio::config.true 'USE_EXTERNAL_DB'; then
|
if bashio::config.true 'USE_EXTERNAL_DB'; then
|
||||||
bashio::log.info "External DB in use; skipping internal Postgres bootstrap."
|
bashio::log.info "External DB in use; skipping internal Postgres bootstrap."
|
||||||
exit 0
|
DB_USER="$(bashio::config 'DB_USERNAME')"
|
||||||
|
DB_PASS="$(bashio::config 'DB_PASSWORD')"
|
||||||
|
DB_NAME="$(bashio::config 'DB_DATABASE_NAME')"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
bashio::log.info "Bootstrapping internal Postgres cluster…"
|
bashio::log.info "Bootstrapping Postgres cluster…"
|
||||||
|
|
||||||
DB_USER="$(bashio::config 'DB_USERNAME')"
|
|
||||||
DB_PASS="$(bashio::config 'DB_PASSWORD')"
|
|
||||||
DB_NAME="$(bashio::config 'DB_DATABASE_NAME')"
|
|
||||||
|
|
||||||
# Wait for postgres service (localhost)
|
# Wait for postgres service (localhost)
|
||||||
until pg_isready -q -h localhost -p 5432 -U postgres; do
|
until pg_isready -q -h localhost -p 5432 -U postgres; do
|
||||||
@@ -59,11 +61,11 @@ BEGIN
|
|||||||
END
|
END
|
||||||
\$\$;
|
\$\$;
|
||||||
SQL
|
SQL
|
||||||
|
bashio::log.info "Internal Postgres ready."
|
||||||
bashio::log.info "Internal Postgres ready."
|
|
||||||
|
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
#################
|
#################
|
||||||
# Minio startup #
|
# Minio startup #
|
||||||
#################
|
#################
|
||||||
|
|||||||
Reference in New Issue
Block a user