From 32ada7f09d0e0a2fcd2e9d3235dd200d491e5a8e Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Tue, 19 Mar 2024 06:59:19 +0100 Subject: [PATCH] Update 99-run.sh --- linkwarden/rootfs/etc/cont-init.d/99-run.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/linkwarden/rootfs/etc/cont-init.d/99-run.sh b/linkwarden/rootfs/etc/cont-init.d/99-run.sh index 2eabc49cc..f4e8a0020 100755 --- a/linkwarden/rootfs/etc/cont-init.d/99-run.sh +++ b/linkwarden/rootfs/etc/cont-init.d/99-run.sh @@ -27,6 +27,12 @@ echo "... starting server" service postgresql start & true sleep 5 +echo "... create user" +# Create database if does not exist +echo "CREATE ROLE postgres WITH LOGIN SUPERUSER CREATEDB CREATEROLE PASSWORD 'homeassistant'; +\q"> setup_postgres.sql +psql "postgres://postgres:homeassistant&localhost:5432/linkwarden" < setup_postgres.sql || true + if [ -e /config/postgres/postgresql.conf ]; then echo "... database already configured" else