X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?p=sim%2Fe2-interface.git;a=blobdiff_plain;f=e2sim%2Fprevious%2Fhelm%2Fe2sim%2Ftemplates%2Fbin%2F_e2sim-run.sh.tpl;fp=e2sim%2Fprevious%2Fhelm%2Fe2sim%2Ftemplates%2Fbin%2F_e2sim-run.sh.tpl;h=0000000000000000000000000000000000000000;hp=35e01c4f99df56ec88d2b6819ea78075baf93f40;hb=f86662b5b6481f27e18313a36355871f3a947193;hpb=a9f02a2b5886990fd81e64f7c218c5d4844f18a3 diff --git a/e2sim/previous/helm/e2sim/templates/bin/_e2sim-run.sh.tpl b/e2sim/previous/helm/e2sim/templates/bin/_e2sim-run.sh.tpl deleted file mode 100755 index 35e01c4..0000000 --- a/e2sim/previous/helm/e2sim/templates/bin/_e2sim-run.sh.tpl +++ /dev/null @@ -1,54 +0,0 @@ -{{/* - Copyright (c) 2019 AT&T Intellectual Property. - Copyright (c) 2019 Nokia. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -*/}} -#!/bin/sh - -# Launch the e2 simulator on ${E2SIM_BIND_ADDR}:${E2SIM_BIND_PORT} -# If E2SIM_BIND_ADDR is not supplied, picks the address of the interface -# associated with the default route for E2SIM_BIND_AF (either -# "inet" [default] or "inet6"). - -if [ -z "${E2SIM_BIND_ADDR}" ]; then - if [ `echo "x${E2SIM_BIND_AF}x" | tr [A-Z] [a-z]` != "xinet6x" ]; then - AF='inet' - DEFROUTE='0/0' - LO='127.0.0.1' - else - AF='inet6' - DEFROUTE='::0/0' - LO='00:00:00:00:00:00' - fi - if [ -z "${E2SIM_BIND_IF}" ]; then - # bind on the address associated with the default route - E2SIM_BIND_IF=`ip -br -f ${AF} route show ${DEFROUTE}| sed 's/.*dev[\ ]*\([^\ ]*\).*/\1/'` - if [ -z ${E2SIM_BIND_IF} ]; then - # this is kinda bogus, but it's the only real fallback: take the first - # non-loopback interface. - E2SIM_BIND_IF=`ip -f ${AF} -o link list up | grep -v LOOPBACK | head -1 |awk -F: '{print $2}'` - fi - fi - E2SIM_BIND_ADDR=`ip -f ${AF} -o addr show ${E2SIM_BIND_IF:-eth0} scope global | sed -e 's/.*inet[6\ ]*\([^\ ]*\)\/.*/\1/'` -fi - -if [ -z $E2SIM_BIND_ADDR ]; then - # search failed. be nondestructively useless. - echo "No suitable address found, binding on loopback addess ${LO}" - E2SIM_BIND_ADDR=${LO} -else - echo "e2sim starting at ${E2SIM_BIND_ADDR}:${E2SIM_PORT:-36421}" -fi - -${E2SIM:-/home/e2sim/build/e2sim} ${E2SIM_BIND_ADDR} ${E2SIM_PORT:-36421}