diff --git a/11.0/entrypoint.sh b/11.0/entrypoint.sh index 5638e6d..8e7626d 100755 --- a/11.0/entrypoint.sh +++ b/11.0/entrypoint.sh @@ -12,11 +12,12 @@ set -e DB_ARGS=() function check_config() { param="$1" - value="$2" - if ! grep -q -E "^\s*\b${param}\b\s*=" "$ODOO_RC" ; then - DB_ARGS+=("--${param}") - DB_ARGS+=("${value}") - fi; + value="$2" + if grep -q -E "^\s*\b${param}\b\s*=" "$ODOO_RC" ; then + value=$(grep -E "^\s*\b${param}\b\s*=" "$ODOO_RC" |cut -d " " -f3|sed 's/["\n\r]//g') + fi; + DB_ARGS+=("--${param}") + DB_ARGS+=("${value}") } check_config "db_host" "$HOST" check_config "db_port" "$PORT" diff --git a/12.0/entrypoint.sh b/12.0/entrypoint.sh index 5638e6d..6dd42c4 100755 --- a/12.0/entrypoint.sh +++ b/12.0/entrypoint.sh @@ -13,10 +13,11 @@ DB_ARGS=() function check_config() { param="$1" value="$2" - if ! grep -q -E "^\s*\b${param}\b\s*=" "$ODOO_RC" ; then - DB_ARGS+=("--${param}") - DB_ARGS+=("${value}") - fi; + if grep -q -E "^\s*\b${param}\b\s*=" "$ODOO_RC" ; then + value=$(grep -E "^\s*\b${param}\b\s*=" "$ODOO_RC" |cut -d " " -f3|sed 's/["\n\r]//g') + fi; + DB_ARGS+=("--${param}") + DB_ARGS+=("${value}") } check_config "db_host" "$HOST" check_config "db_port" "$PORT" diff --git a/13.0/entrypoint.sh b/13.0/entrypoint.sh index 5638e6d..6dd42c4 100755 --- a/13.0/entrypoint.sh +++ b/13.0/entrypoint.sh @@ -13,10 +13,11 @@ DB_ARGS=() function check_config() { param="$1" value="$2" - if ! grep -q -E "^\s*\b${param}\b\s*=" "$ODOO_RC" ; then - DB_ARGS+=("--${param}") - DB_ARGS+=("${value}") - fi; + if grep -q -E "^\s*\b${param}\b\s*=" "$ODOO_RC" ; then + value=$(grep -E "^\s*\b${param}\b\s*=" "$ODOO_RC" |cut -d " " -f3|sed 's/["\n\r]//g') + fi; + DB_ARGS+=("--${param}") + DB_ARGS+=("${value}") } check_config "db_host" "$HOST" check_config "db_port" "$PORT"