From: Benjamin Diaz Date: Tue, 5 Mar 2019 17:28:32 +0000 (-0300) Subject: Adds support in entrypoint script for more complex mysql URI (+pool and query params) X-Git-Tag: v6.0.0~19 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F80%2F7280%2F1;p=osm%2FMON.git Adds support in entrypoint script for more complex mysql URI (+pool and query params) Change-Id: I71445bbd489b905cb796eff294997a83e4d4cb91 Signed-off-by: Benjamin Diaz --- diff --git a/docker/scripts/start.sh b/docker/scripts/start.sh index fc0b3c3..8e2880b 100644 --- a/docker/scripts/start.sh +++ b/docker/scripts/start.sh @@ -37,11 +37,11 @@ function is_db_created() { } if [[ $OSMMON_SQL_DATABASE_URI == *'mysql'* ]]; then - DB_HOST=$(echo $OSMMON_SQL_DATABASE_URI | sed -r 's|^\w+://.+:.+@(.+):.*$|\1|') - DB_PORT=$(echo $OSMMON_SQL_DATABASE_URI | sed -r 's|^\w+://.*:([0-9]+).*$|\1|') - DB_USER=$(echo $OSMMON_SQL_DATABASE_URI | sed -r 's|^\w+://(.+):.+@.+$|\1|') + DB_HOST=$(echo $OSMMON_SQL_DATABASE_URI | sed -r 's|^.+://.+:.+@(.+):.*$|\1|') + DB_PORT=$(echo $OSMMON_SQL_DATABASE_URI | sed -r 's|^.+://.*:([0-9]+).*$|\1|') + DB_USER=$(echo $OSMMON_SQL_DATABASE_URI | sed -r 's|^.+://(.+):.+@.+$|\1|') DB_PASSWORD=$(echo $OSMMON_SQL_DATABASE_URI | sed -r 's|^.+://.+:(.+)@.*$|\1|') - DB_NAME=$(echo $OSMMON_SQL_DATABASE_URI | sed -r 's|^\w+://.+:.+@.+:.*/(.+)$|\1|') + DB_NAME=$(echo $OSMMON_SQL_DATABASE_URI | sed -r 's|^.+://.+:.+@.+:.*/(\w+)(\?.*)?$|\1|') wait_db "$DB_HOST" "$DB_PORT" || exit 1