mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-16 20:39:12 +02:00
Show log
This commit is contained in:
@@ -332,42 +332,38 @@ main() {
|
|||||||
|
|
||||||
bashio::log.info "Waiting for PostgreSQL to start..."
|
bashio::log.info "Waiting for PostgreSQL to start..."
|
||||||
|
|
||||||
(
|
DB_PORT=5432
|
||||||
DB_PORT=5432
|
DB_HOSTNAME=localhost
|
||||||
DB_HOSTNAME=localhost
|
DB_PASSWORD="$(bashio::config 'POSTGRES_PASSWORD')"
|
||||||
DB_PASSWORD="$(bashio::config 'POSTGRES_PASSWORD')"
|
DB_PASSWORD="$(jq -rn --arg x "$DB_PASSWORD" '$x|@uri')"
|
||||||
DB_PASSWORD="$(jq -rn --arg x "$DB_PASSWORD" '$x|@uri')"
|
DB_USERNAME=postgres
|
||||||
DB_USERNAME=postgres
|
if bashio::config.has_value "POSTGRES_USER"; then
|
||||||
if bashio::config.has_value "POSTGRES_USER"; then
|
DB_USERNAME="$(bashio::config "POSTGRES_USER")"
|
||||||
DB_USERNAME="$(bashio::config "POSTGRES_USER")"
|
fi
|
||||||
fi
|
export DB_PORT DB_HOSTNAME DB_USERNAME DB_PASSWORD
|
||||||
export DB_PORT DB_HOSTNAME DB_USERNAME DB_PASSWORD
|
|
||||||
|
|
||||||
wait_for_postgres
|
wait_for_postgres
|
||||||
|
restart_immich_addons_if_flagged
|
||||||
|
|
||||||
restart_immich_addons_if_flagged
|
su - postgres -c "psql -d postgres -c 'DROP EXTENSION IF EXISTS vectors CASCADE;'"
|
||||||
|
|
||||||
# Remove vectors from 'postgres' db only (safe, idempotent)
|
upgrade_extension_if_needed "vectors"
|
||||||
su - postgres -c "psql -d postgres -c 'DROP EXTENSION IF EXISTS vectors CASCADE;'"
|
upgrade_extension_if_needed "vchord"
|
||||||
|
show_db_extensions
|
||||||
|
|
||||||
upgrade_extension_if_needed "vectors"
|
if [ "$RESTART_NEEDED" = true ]; then
|
||||||
upgrade_extension_if_needed "vchord"
|
bashio::log.warning "A critical update (Postgres or extension) occurred. Will trigger Immich add-on restart after DB comes back up."
|
||||||
show_db_extensions
|
touch "$RESTART_FLAG_FILE"
|
||||||
|
bashio::addon.restart
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$RESTART_NEEDED" = true ]; then
|
bashio::log.info "All initialization/version check steps completed successfully!"
|
||||||
bashio::log.warning "A critical update (Postgres or extension) occurred. Will trigger Immich add-on restart after DB comes back up."
|
|
||||||
touch "$RESTART_FLAG_FILE"
|
|
||||||
bashio::addon.restart
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
bashio::log.info "All initialization/version check steps completed successfully!"
|
if [ -d /config/backups ]; then
|
||||||
|
echo "Cleaning /config/backups now that upgrade is done"
|
||||||
if [ -d /config/backups ]; then
|
rm -r /config/backups
|
||||||
echo "Cleaning /config/backups now that upgrade is done"
|
fi
|
||||||
rm -r /config/backups
|
|
||||||
fi
|
|
||||||
) & true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
main
|
main
|
||||||
|
|||||||
Reference in New Issue
Block a user