Use same shell

This commit is contained in:
Alexandre
2025-02-15 12:11:33 +01:00
parent b4f13c4104
commit d57cd4255b
2 changed files with 42 additions and 43 deletions

View File

@@ -38,5 +38,5 @@
"slug": "postgres", "slug": "postgres",
"udev": true, "udev": true,
"url": "https://github.com/alexbelgium/hassio-addons/tree/master/postgres", "url": "https://github.com/alexbelgium/hassio-addons/tree/master/postgres",
"version": "15.7-28" "version": "15.7-29"
} }

View File

@@ -59,6 +59,8 @@ fi
bashio::log.info "Waiting for PostgreSQL to start..." bashio::log.info "Waiting for PostgreSQL to start..."
( bashio::net.wait_for 5432 localhost 900
# Set PostgreSQL connection variables # Set PostgreSQL connection variables
DB_PORT=5432 DB_PORT=5432
DB_HOSTNAME=localhost DB_HOSTNAME=localhost
@@ -69,8 +71,6 @@ if bashio::config.has_value "POSTGRES_USER"; then
fi fi
export DB_PORT DB_HOSTNAME DB_USERNAME DB_PASSWORD export DB_PORT DB_HOSTNAME DB_USERNAME DB_PASSWORD
( bashio::net.wait_for 5432 localhost 900
until pg_isready -h "$DB_HOSTNAME" -p "$DB_PORT" -U "$DB_USERNAME" >/dev/null 2>&1; do until pg_isready -h "$DB_HOSTNAME" -p "$DB_PORT" -U "$DB_USERNAME" >/dev/null 2>&1; do
echo "PostgreSQL is starting up..." echo "PostgreSQL is starting up..."
sleep 2 sleep 2
@@ -81,7 +81,6 @@ done
############################### ###############################
update_postgres() { update_postgres() {
# Read the previous PostgreSQL version from file # Read the previous PostgreSQL version from file
OLD_PG_VERSION=$(cat "$PG_VERSION_FILE" 2>/dev/null || echo "$PG_MAJOR_VERSION") OLD_PG_VERSION=$(cat "$PG_VERSION_FILE" 2>/dev/null || echo "$PG_MAJOR_VERSION")