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,32 +161,19 @@ rotate_log_file () { ...@@ -161,32 +161,19 @@ 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 export OPENAIR_DIR=$openair_path
index=`echo $path | grep -b -o $i | cut -d: -f1` export OPENAIR_HOME=$openair_path
#echo ${path%$token*} export OPENAIR1_DIR=$openair_path/openair1
if [[ $index -lt $length_path && index -gt 0 ]] export OPENAIR2_DIR=$openair_path/openair2
then export OPENAIR3_DIR=$openair_path/openair3
declare -x OPENAIR_DIR export OPENAIRCN_DIR=$openair_path/openair-cn
index=`expr $index - 1` export OPENAIR_TARGETS=$openair_path/targets
openair_path=`echo $path | cut -c1-$index`
#openair_path=`echo ${path:0:$index}`
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
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