From 97d917550590732b403d7dd893b1f6692853d475 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Fri, 6 Dec 2024 14:42:51 +0100 Subject: [PATCH] Update 99-run.sh --- monica/rootfs/etc/cont-init.d/99-run.sh | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/monica/rootfs/etc/cont-init.d/99-run.sh b/monica/rootfs/etc/cont-init.d/99-run.sh index 67d7ce4ea..bcc81e1e2 100755 --- a/monica/rootfs/etc/cont-init.d/99-run.sh +++ b/monica/rootfs/etc/cont-init.d/99-run.sh @@ -18,26 +18,24 @@ export DB_USERNAME="$(bashio::config 'DB_USERNAME')" # Check if DB_HOST is configured if bashio::config.has_value "DB_HOST"; then - bashio::log.info "Manual configuration of mysql detected using host : $DB_HOST" - # Alert if mariadb is available + bashio::log.info "Manual configuration of MySQL detected using host: $DB_HOST" + # Alert if MariaDB is available 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 # Verify all variables are set for var in DB_DATABASE DB_HOST DB_PASSWORD DB_PORT DB_USERNAME; do if ! bashio::config.has_value "$var"; then - bashio::log.fatal "You have selected to not use the automatic Mariadb detection by manually configuring the addon options, but the option $var is not set." + bashio::log.fatal "You have selected to not use the automatic MariaDB detection by manually configuring the addon options, but the option $var is not set." + exit 1 fi - exit 1 - fi + done else - # User Mariadb - bashio::log.info "Using MariaDB addon. Requirements : running MariaDB addon. Discovering values..." + # Use MariaDB + bashio::log.info "Using MariaDB addon. Requirements: running MariaDB addon. Discovering values..." if ! bashio::services.available 'mysql'; then - bashio::log.fatal \ - "Local database access should be provided by the MariaDB addon" - bashio::exit.nok \ - "Please ensure it is installed and started" + bashio::log.fatal "Local database access should be provided by the MariaDB addon" + bashio::exit.nok "Please ensure it is installed and started" fi # Use values @@ -47,10 +45,9 @@ else export DB_USERNAME=$(bashio::services "mysql" "username") && bashio::log.blue "DB_USERNAME=$DB_USERNAME" && sed "1a export DB_USERNAME=$DB_USERNAME" /usr/local/bin/entrypoint.sh export DB_PASSWORD=$(bashio::services "mysql" "password") && bashio::log.blue "DB_PASSWORD=$DB_PASSWORD" && sed "1a export DB_PASSWORD=$DB_PASSWORD" /usr/local/bin/entrypoint.sh - bashio::log.warning "Monica is using the Maria DB addon" + 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" - fi ###########