Update 99-run.sh

This commit is contained in:
Alexandre
2024-03-19 12:43:18 +01:00
committed by GitHub
parent f79f8805fd
commit f3b93d2a50

View File

@@ -22,7 +22,9 @@ mkdir -p /var/run/postgresql
chown postgres:postgres /var/run/postgresql
chown -R postgres:postgres /config/postgres
chmod 0700 /config/postgres
# Create folder
if [ ! -e /config/postgres/postgresql.conf ]; then
echo "... init folder"
sudo -u postgres /usr/lib/postgresql/16/bin/initdb -D /config/postgres
fi
chown -R postgres:postgres /config/postgres
@@ -41,7 +43,6 @@ echo "CREATE ROLE postgres WITH LOGIN SUPERUSER CREATEDB CREATEROLE PASSWORD 'ho
CREATE DATABASE linkwarden; CREATE USER postgres WITH ENCRYPTED PASSWORD 'homeassistant'; GRANT ALL PRIVILEGES ON DATABASE linkwarden to postgres;
\q"> setup_postgres.sql
sudo -u postgres psql "postgres://postgres:homeassistant@localhost:5432" < setup_postgres.sql || true
fi
########################