Commit 46d3b2e0 authored by ismail's avatar ismail

entrypoint updated to handle already set config file

Signed-off-by: default avatarismail <mohammed.ismail@openairinterface.org>
parent aa7c2acc
......@@ -5,6 +5,10 @@ CONFIG_DIR="/openair-nrf/etc"
for c in ${CONFIG_DIR}/*.conf; do
# grep variable names (format: ${VAR}) from template to be rendered
if ! grep -oP '@[a-zA-Z0-9_]+@' ${c}; then
echo "Configuration is already set"
exec "$@"
fi
VARS=$(grep -oP '@[a-zA-Z0-9_]+@' ${c} | sort | uniq | xargs)
echo "Now setting these variables '${VARS}'"
# create sed expressions for substituting each occurrence of ${VAR}
......@@ -25,4 +29,4 @@ for c in ${CONFIG_DIR}/*.conf; do
sed -i "${EXPRESSIONS}" ${c}
done
echo "Done setting the configuration"
exec "$@"
\ No newline at end of file
exec "$@"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment