Extract common setup code and add wombat
This commit is contained in:
34
site_ansto/instrument/TEST_SICS/setup/common
Executable file
34
site_ansto/instrument/TEST_SICS/setup/common
Executable file
@@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
echo ${0}
|
||||
echo $(dirname ${0}) + common
|
||||
if [ -f ${PWD}/${0} ]; then
|
||||
echo True: ${PWD}/${0}
|
||||
else
|
||||
echo False: ${PWD}/${0}
|
||||
fi
|
||||
if [ -d TEST_SICS ]; then
|
||||
root=$PWD/TEST_SICS
|
||||
elif [ $(basename $PWD) == "TEST_SICS" ]; then
|
||||
root=$PWD
|
||||
else
|
||||
root=${PWD}
|
||||
while [ "${root}" != "/" ]; do
|
||||
echo ${root}
|
||||
if [ $(basename ${root}) == "TEST_SICS" ]; then
|
||||
break
|
||||
fi
|
||||
root=$(dirname ${root})
|
||||
done
|
||||
fi
|
||||
echo Root:${root}
|
||||
if [ $(basename ${root}) != "TEST_SICS" ]; then
|
||||
echo "Can't find TEST_SICS directory"
|
||||
exit 1
|
||||
fi
|
||||
for f in setup fakeGalil fakeTempControl; do
|
||||
if [ ! -d ${root}/${f} ]; then
|
||||
echo "Can't find ${f} directory"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user