From 38638a592098655f50d98985d5f70adea0795854 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Tue, 13 May 2025 14:23:34 +0200 Subject: [PATCH] Lint --- linkwarden/rootfs/etc/cont-init.d/99-run.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/linkwarden/rootfs/etc/cont-init.d/99-run.sh b/linkwarden/rootfs/etc/cont-init.d/99-run.sh index a7948beb3..bad624b6e 100755 --- a/linkwarden/rootfs/etc/cont-init.d/99-run.sh +++ b/linkwarden/rootfs/etc/cont-init.d/99-run.sh @@ -18,7 +18,7 @@ if [[ "$DATABASE_URL" == *"localhost"* ]]; then echo "... with local database" echo "... set database in /config/postgres" mkdir -p /config/postgres - mkdir -p /var/run/postgresql + mkdir -p /var/run/postgresql chown postgres:postgres /var/run/postgresql chown -R postgres:postgres /config/postgres chmod 0700 /config/postgres @@ -29,19 +29,19 @@ if [[ "$DATABASE_URL" == *"localhost"* ]]; then fi chown -R postgres:postgres /config/postgres chmod 0700 /config/postgres - + echo "... starting server" sudo -u postgres service postgresql start sleep 5 - + echo "... create user and table" # Set password sudo -u postgres psql -c "ALTER USER postgres WITH PASSWORD 'homeassistant';" - + # Create database if does not exist echo "CREATE DATABASE linkwarden; 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 + sudo -u postgres bash -c 'psql "postgres://postgres:homeassistant@localhost:5432"' < setup_postgres.sql || true fi ########################