From abd39b5cfb4fe6e7d76b223718574b30d84d71d4 Mon Sep 17 00:00:00 2001 From: Hans Date: Thu, 7 May 2020 22:04:12 +0200 Subject: [PATCH] Provided autorun and extended readme. --- README.md | 2 +- timescaledb/rootfs/etc/services.d/postgres/run | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 9a4279e..b6dd89f 100644 --- a/README.md +++ b/README.md @@ -117,7 +117,7 @@ The default is port `5432` __Securiy Notice!__ -The default username is `postgres` with an __empty password__. +The default username is `postgres` with password `homeassistant`. Make sure you change this immediately after activating the add-on: ``` diff --git a/timescaledb/rootfs/etc/services.d/postgres/run b/timescaledb/rootfs/etc/services.d/postgres/run index 11c3a57..7faae37 100644 --- a/timescaledb/rootfs/etc/services.d/postgres/run +++ b/timescaledb/rootfs/etc/services.d/postgres/run @@ -51,13 +51,13 @@ postgres_pid=$! bashio::log.info "done" # Wait for postgres to become availale.. -sleep 3 -#while ! psql -U "postgres" postgres -c "SELECT 1;" 2> /dev/null; do -# sleep 1 -#done +while ! psql -U "postgres" postgres -c "" 2> /dev/null; do + sleep 1 +done # Create extensions timescaledb in initial databases if bashio::var.true "${new_install}"; then + psql -U "postgres" postgres -c "ALTER USER postgres WITH PASSWORD 'homeassistant';" psql -U "postgres" postgres -c "CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;" psql -U "postgres" template1 -c "CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;" fi