This commit is contained in:
Alexandre
2021-12-27 23:27:18 +01:00
parent 3d854c2f88
commit ccc1fbf583

View File

@@ -38,7 +38,7 @@ sqlite_internal)
# Use MariaDB # Use MariaDB
mariadb_addon) mariadb_addon)
bashio::log.info "Using MariaDB addon. Requirements : running MariaDB addon" bashio::log.info "Using MariaDB addon. Requirements : running MariaDB addon. Detecting values..."
if ! bashio::services.available 'mysql'; then if ! bashio::services.available 'mysql'; then
bashio::log.fatal \ bashio::log.fatal \
"Local database access should be provided by the MariaDB addon" "Local database access should be provided by the MariaDB addon"
@@ -46,21 +46,23 @@ mariadb_addon)
"Please ensure it is installed and started" "Please ensure it is installed and started"
fi fi
# Use values
export DB_CONNECTION=mysql export DB_CONNECTION=mysql
host=$(bashio::services "mysql" "host") export DB_HOST=$(bashio::services "mysql" "host") && bashio::log.blue "DB_HOST=$DB_HOST"
password=$(bashio::services "mysql" "password") export DB_PORT=$(bashio::services "mysql" "port") && bashio::log.blue "DB_PORT=$DB_PORT"
port=$(bashio::services "mysql" "port") export DB_DATABASE=firefly && bashio::log.blue "DB_DATABASE=$DB_DATABASE"
username=$(bashio::services "mysql" "username") export DB_USERNAME=$(bashio::services "mysql" "username") && bashio::log.blue "DB_USERNAME=$DB_USERNAME"
export DB_PASSWORD=$(bashio::services "mysql" "password") && bashio::log.blue "DB_PASSWORD=$DB_PASSWORD"
bashio::log.warning "Firefly-iii is using the Maria DB addon" bashio::log.warning "Firefly-iii is using the Maria DB addon"
bashio::log.warning "Please ensure this is included in your backups" bashio::log.warning "Please ensure this is included in your backups"
bashio::log.warning "Uninstalling the MariaDB addon will remove any data" bashio::log.warning "Uninstalling the MariaDB addon will remove any data"
bashio::log.info "Creating database for Firefly-iii if required" #bashio::log.info "Creating database for Firefly-iii if required"
mysql3 \ #mysql3 \
-u "${username}" -p"${password}" \ # -u "${username}" -p"${password}" \
-h "${host}" -P "${port}" \ # -h "${host}" -P "${port}" \
-e "CREATE DATABASE IF NOT EXISTS \`firefly\` ;" # -e "CREATE DATABASE IF NOT EXISTS \`firefly\` ;"
;; ;;
# Use remote # Use remote