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 () {
}
set_openair() {
path=`pwd`
declare -i length_path
declare -i index
length_path=${#path}
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]/*}
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_HOME=$openair_path
export OPENAIR1_DIR=$openair_path/openair1
......@@ -183,10 +174,6 @@ set_openair() {
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 () {
......
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