#!/bin/bash . lib/common ## XXXvlab: should get location of code #CONFIG=$(echo $COMPOSE_CONFIG | shyaml get-value $SERVICE_NAME.relations.publish-dir...) # CONFIG="$SERVICE_DATASTORE/opt/apps/piwigo/local/config/database.inc.php" set -e PASSWORD="$(relation-get password)" USER="$(relation-get user)" DBNAME="$(relation-get dbname)" crudini --set "$MATOMO_CONFIG_FILE" database host "\"$TARGET_SERVICE_NAME\"" crudini --set "$MATOMO_CONFIG_FILE" database username "\"$USER\"" crudini --set "$MATOMO_CONFIG_FILE" database password "\"$PASSWORD\"" crudini --set "$MATOMO_CONFIG_FILE" database dbname "\"$DBNAME\"" crudini --set "$MATOMO_CONFIG_FILE" database tables_prefix "\"\"" crudini --set "$MATOMO_CONFIG_FILE" database charset "\"utf8mb4\"" info "Configured $SERVICE_NAME code for $TARGET_SERVICE_NAME access."