From b7170807d573f6fef08decb1c4ccd18c6b4a8797 Mon Sep 17 00:00:00 2001 From: "Arnaud G. GIBERT" Date: Mon, 13 Jan 2025 10:36:28 +0100 Subject: [PATCH] - Replace ENV_SED by ENV_NET_SED environment variable. --- ReleaseNotes.txt | 8 ++++++++ sbin/docker_mk_env | 14 ++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index 3256f4c..fffdd66 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -1,3 +1,11 @@ +------------------------------------------------------------------------------------------------------------------------------------ +Rx3-Docker/Docker Tools V 1.3.4 - A. GIBERT - 2025/01/13 +------------------------------------------------------------------------------------------------------------------------------------ + +- Replace ENV_SED by ENV_NET_SED environment variable. + + + ------------------------------------------------------------------------------------------------------------------------------------ Rx3-Docker/Docker Tools V 1.3.3 - A. GIBERT - 2025/01/05 ------------------------------------------------------------------------------------------------------------------------------------ diff --git a/sbin/docker_mk_env b/sbin/docker_mk_env index 54b362b..e44946e 100755 --- a/sbin/docker_mk_env +++ b/sbin/docker_mk_env @@ -415,15 +415,25 @@ fi >${APPL_HOME_DIR}/.env +ENV_SED="" +ENV_NET_SED="" for var in $( ( grep "^ *[a-zA-Z0-9_-]*=" ${APPL_HOME_DIR}/env | sed -e "s/=.*//" -e "s/ *//"; echo ${DYNVAR_LIST} | sed -e 's/ /\n/g') | sort -u) do echo "${var}='${!var}'" >>${APPL_HOME_DIR}/.env - ENV_SED="${ENV_SED}s/\${${var}}/${!var//\//\\/}/g + + + pat="s/\${${var}}/${!var//\//\\/}/g " + ENV_SED="${ENV_SED}${pat}" + + if [[ ${var} =~ _HOST_ ]] || ( [[ ${var} =~ _PORT_ ]] && [[ ${var} =~ _INT ]]) + then + ENV_NET_SED="${ENV_NET_SED}${pat}" + fi done -echo ENV_SED=\'"${ENV_SED}"\' >>${APPL_HOME_DIR}/.env +echo ENV_NET_SED=\'"${ENV_NET_SED}"\' >>${APPL_HOME_DIR}/.env