From 74b7009f48edb75ff844ffa022147705330852f6 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Fri, 6 Dec 2024 20:29:56 +0100 Subject: [PATCH] Update 99-run.sh --- monica/rootfs/etc/cont-init.d/99-run.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/monica/rootfs/etc/cont-init.d/99-run.sh b/monica/rootfs/etc/cont-init.d/99-run.sh index 9ebd40618..acbc52ec8 100755 --- a/monica/rootfs/etc/cont-init.d/99-run.sh +++ b/monica/rootfs/etc/cont-init.d/99-run.sh @@ -42,6 +42,10 @@ case "$database" in bashio::log.warning "Monica is using the MariaDB addon" bashio::log.warning "Please ensure this is included in your backups" bashio::log.warning "Uninstalling the MariaDB addon will remove any data" + + # Create database + mysql --host="$DB_HOST" --port="$DB_PORT" --user="$DB_USERNAME" --password="$DB_PASSWORD" -e"CREATE DATABASE IF NOT EXISTS $DB_DATABASE;" + ;; # Use Mariadb_addon @@ -60,6 +64,10 @@ case "$database" in if bashio::services.available 'mysql'; then bashio::log.warning "The MariaDB addon is available, but you have selected to use your own database by manually configuring the addon options" fi + + # Create database + mysql --host="$DB_HOST" --port="$DB_PORT" --user="$DB_USERNAME" --password="$DB_PASSWORD" -e"CREATE DATABASE IF NOT EXISTS $DB_DATABASE;" + ;; esac