Commit c729f6cf authored by thomasl's avatar thomasl

fix directories detection function


git-svn-id: http://svn.eurecom.fr/openair4G/trunk@6019 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 5cd48016
...@@ -161,21 +161,12 @@ rotate_log_file () { ...@@ -161,21 +161,12 @@ rotate_log_file () {
} }
set_openair() { set_openair() {
path=`pwd` fullpath=`readlink -f $BASH_SOURCE`
declare -i length_path [ -f "/.$fullpath" ] || fullpath=`readlink -f $PWD/$fullpath`
declare -i index openair_path=${fullpath%/targets/*}
length_path=${#path} openair_path=${openair_path%/openair-cn/*}
openair_path=${openair_path%/openair[123]/*}
for i in 'openair1' 'openair2' 'openair3' 'openair-cn' 'targets'
do
index=`echo $path | grep -b -o $i | cut -d: -f1`
#echo ${path%$token*}
if [[ $index -lt $length_path && index -gt 0 ]]
then
declare -x OPENAIR_DIR
index=`expr $index - 1`
openair_path=`echo $path | cut -c1-$index`
#openair_path=`echo ${path:0:$index}`
export OPENAIR_DIR=$openair_path export OPENAIR_DIR=$openair_path
export OPENAIR_HOME=$openair_path export OPENAIR_HOME=$openair_path
export OPENAIR1_DIR=$openair_path/openair1 export OPENAIR1_DIR=$openair_path/openair1
...@@ -183,10 +174,6 @@ set_openair() { ...@@ -183,10 +174,6 @@ set_openair() {
export OPENAIR3_DIR=$openair_path/openair3 export OPENAIR3_DIR=$openair_path/openair3
export OPENAIRCN_DIR=$openair_path/openair-cn export OPENAIRCN_DIR=$openair_path/openair-cn
export OPENAIR_TARGETS=$openair_path/targets export OPENAIR_TARGETS=$openair_path/targets
return 0
fi
done
return -1
} }
wait_process_started () { wait_process_started () {
......
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