mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-07-23 06:20:31 +02:00
Update 99-run.sh
This commit is contained in:
@@ -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."
|
||||
fi
|
||||
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
|
||||
done
|
||||
else
|
||||
# User Mariadb
|
||||
# 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
|
||||
@@ -50,7 +48,6 @@ else
|
||||
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
|
||||
|
||||
###########
|
||||
|
||||
Reference in New Issue
Block a user