From 048c7df304278f968f73b74382e2b2d12bc12ebc Mon Sep 17 00:00:00 2001 From: Sagar Arora Date: Tue, 18 Oct 2022 16:48:32 +0200 Subject: [PATCH] (fix): Remove the AMF FQDN parameter - there are extra variables in gnb_entrypoint.sh to resolve FQDN which are superfluous - allowing nrue config to use gnb fqdn and ip-address - rfsimulator parameter is not used in all docker-compose so it should be optional - make amf ip-address optional --- docker/scripts/gnb_entrypoint.sh | 8 +++----- docker/scripts/nr_ue_entrypoint.sh | 4 ++++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/docker/scripts/gnb_entrypoint.sh b/docker/scripts/gnb_entrypoint.sh index 38ff92ace5..c3c4ef0b2d 100755 --- a/docker/scripts/gnb_entrypoint.sh +++ b/docker/scripts/gnb_entrypoint.sh @@ -21,11 +21,9 @@ if [[ -v USE_VOLUMED_CONF ]]; then cp $PREFIX/etc/mounted.conf $PREFIX/etc/gnb.c # Defualt Parameters GNB_ID=${GNB_ID:-e00} NSSAI_SD=${NSSAI_SD:-ffffff} -USE_FQDN=${USE_FQDN:-false} -AMF_FQDN=${AMF_FQDN:-oai-amf-svc} - -# Resolve AMF FQDN -if ($USE_FQDN); then AMF_IP_ADDRESS=(`getent hosts $AMF_FQDN | awk '{print $1}'`); fi +# AMF_IP_ADDRESS can be amf ip address of amf fqdn +if [[ -v AMF_IP_ADDRESS ]] && [[ "${AMF_IP_ADDRESS}" =~ [a-zA-Z] ]] && [[ -z `getent hosts $AMF_IP_ADDRESS | awk '{print $1}'` ]]; then echo "not able to resolve AMF FQDN" && exit 1 ; fi +[[ -v AMF_IP_ADDRESS ]] && [[ "${AMF_IP_ADDRESS}" =~ [a-zA-Z] ]] && AMF_IP_ADDRESS=$(getent hosts $AMF_IP_ADDRESS | awk '{print $1}') # Only this template will be manipulated CONFIG_FILES=`ls $PREFIX/etc/gnb.conf || true` diff --git a/docker/scripts/nr_ue_entrypoint.sh b/docker/scripts/nr_ue_entrypoint.sh index 5757ca397b..4a5899f8b6 100755 --- a/docker/scripts/nr_ue_entrypoint.sh +++ b/docker/scripts/nr_ue_entrypoint.sh @@ -11,6 +11,10 @@ if [[ -v USE_VOLUMED_CONF ]]; then cp $PREFIX/etc/mounted.conf $PREFIX/etc/nr-ue # if none, pick the default if [ ! -f $PREFIX/etc/nr-ue.conf ]; then cp $PREFIX/etc/nr-ue-sim.conf $PREFIX/etc/nr-ue.conf; fi +# RFSIMULATOR can have ip-address or service name +if [[ -v RFSIMULATOR ]] && [[ "${RFSIMULATOR}" =~ [a-zA-Z] ]] && [[ -z `getent hosts $RFSIMULATOR | awk '{print $1}'` ]]; then echo "not able to resolve RFSIMULATOR FQDN" && exit 1 ; fi +[[ -v RFSIMULATOR ]] && [[ "${RFSIMULATOR}" =~ [a-zA-Z] ]] && RFSIMULATOR=$(getent hosts $RFSIMULATOR | awk '{print $1}') + # Only this template will be manipulated CONFIG_FILES=`ls $PREFIX/etc/nr-ue.conf || true`