From 5f973894df95b484b8851b8a7bb8ee8468b31bc0 Mon Sep 17 00:00:00 2001 From: vhsdream Date: Mon, 5 May 2025 13:39:07 -0400 Subject: [PATCH] replace psql commands with sed --- install/immich-install.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/install/immich-install.sh b/install/immich-install.sh index cdf02b1..643c766 100644 --- a/install/immich-install.sh +++ b/install/immich-install.sh @@ -120,13 +120,13 @@ rm vectors-pg17_0.4.0_amd64.deb DB_NAME="immich" DB_USER="immich" DB_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c18) +sed -i -e "/^#shared_preload/s/^#//;/^shared_preload/s/''/'vectors.so'/" \ + -e "/^#search_path/s/^#//;/^search_path/s/public'/public, vectors'/" /etc/postgresql/17/main/postgresql.conf +systemctl restart postgresql.service $STD sudo -u postgres psql -c "CREATE USER $DB_USER WITH ENCRYPTED PASSWORD '$DB_PASS';" $STD sudo -u postgres psql -c "CREATE DATABASE $DB_NAME WITH OWNER $DB_USER ENCODING 'UTF8' TEMPLATE template0;" $STD sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE $DB_NAME to $DB_USER;" $STD sudo -u postgres psql -c "ALTER USER $DB_USER WITH SUPERUSER;" -$STD sudo -u postgres psql -c "ALTER SYSTEM SET shared_preload_libraries = 'vectors.so';" -$STD sudo -u postgres psql -c "ALTER SYSTEM SET search_path TO "$user", public, vectors;" -systemctl restart postgresql.service $STD sudo -u postgres psql -c "DROP EXTENSION IF EXISTS vectors;" $STD sudo -u postgres psql -c "CREATE EXTENSION vectors;" {