Commit 73ecffd9 authored by thomasl's avatar thomasl

fix set_openair() function to be correct from any launching directory


git-svn-id: http://svn.eurecom.fr/openair4G/trunk@6034 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 93b91fb3
......@@ -872,18 +872,19 @@ create_hss_database(){
###############################
set_openair_env(){
index=`pwd | grep -b -o /targets | cut -d: -f1`
if [ $index = "" ] ; then
echo_error "Please run the script from targets directory or any child directories"
else
oai_path=`pwd | cut -c1-$index`
export OPENAIR_HOME=$oai_path
export OPENAIR1_DIR=$oai_path/openair1
export OPENAIR2_DIR=$oai_path/openair2
export OPENAIR3_DIR=$oai_path/openair3
export OPENAIR_TARGETS=$oai_path/targets
export OPENAIRCN_DIR=$oai_path/openair-cn
fi
fullpath=`readlink -f $BASH_SOURCE`
[ -f "/.$fullpath" ] || fullpath=`readlink -f $PWD/$fullpath`
openair_path=${fullpath%/targets/*}
openair_path=${openair_path%/openair-cn/*}
openair_path=${openair_path%/openair[123]/*}
export OPENAIR_DIR=$openair_path
export OPENAIR_HOME=$openair_path
export OPENAIR1_DIR=$openair_path/openair1
export OPENAIR2_DIR=$openair_path/openair2
export OPENAIR3_DIR=$openair_path/openair3
export OPENAIRCN_DIR=$openair_path/openair-cn
export OPENAIR_TARGETS=$openair_path/targets
}
......
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