diff --git a/MAC/APL/APLCommon/src/swlevel b/MAC/APL/APLCommon/src/swlevel index 3906adf6881903cc27875815896851fd3401611a..d70e8c5bf73e7f07111d44382029015ae479f9c5 100755 --- a/MAC/APL/APLCommon/src/swlevel +++ b/MAC/APL/APLCommon/src/swlevel @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash # # swlevel : bring software on node in certain runlevel # @@ -25,9 +25,9 @@ # $Id$ # -if [ "$LOFARROOT" == "" ]; then +if [ -z $LOFARROOT ]; then # default value until all MAC controlled systems provide $LOFARROOT - LOFARROOT=/opt/lofar + export LOFARROOT=/opt/lofar fi BINDIR=$LOFARROOT/bin @@ -150,7 +150,7 @@ selectImage() #if [ "$boardHex" == "03" ]; then # boardHex="1F" #fi - ethport=`grep RSPDriver.IF_NAME /opt/lofar/etc/RSPDriver.conf | awk -F= '{print $2}'` + ethport=`grep RSPDriver.IF_NAME ${ETCDIR}/RSPDriver.conf | awk -F= '{print $2}'` rsu=`timeout 5 sudo ${SBINDIR}/rsuctl3 -i ${ethport} -m 10:fa:00:00:$boardHex:00 -qV 2>&1 | grep BP | cut -d':' -f2 | sed 's/ //g' | cut -d'.' -f1` # If not a single number, something weird must have happened @@ -192,8 +192,8 @@ if [ -e $BINDIR/rspctl ]; then timeout=10 for (( s=0 ; s<timeout; s++ )) do - rsp_ready_1=`( timeout 2 rspctl --version | grep "0.0" ) >& /dev/null; echo $?` - rsp_ready_2=`( timeout 2 rspctl --status | grep "PCB" ) >& /dev/null; echo $?` + rsp_ready_1=`( timeout 2 $BINDIR/rspctl --version | grep "0.0" ) >& /dev/null; echo $?` + rsp_ready_2=`( timeout 2 $BINDIR/rspctl --status | grep "PCB" ) >& /dev/null; echo $?` if [ $rsp_ready_1 == 1 -a $rsp_ready_2 == 1 ]; then echo "RSPDriver died; quitting now" @@ -219,7 +219,7 @@ if [ -e $BINDIR/tbbctl ]; then sleep 10 for (( s=0 ; s<timeout; s++ )) do - tbb_respons=`timeout 2 tbbctl --version` + tbb_respons=`timeout 2 $BINDIR/tbbctl --version` tbb_ready=`( echo $tbb_respons | grep "\ V\ " ) >& /dev/null; echo $?` if [ $tbb_ready -eq 0 ]; then sleep 10 # additional delay to let TBB boards end their init phase diff --git a/MAC/APL/StationCU/src/TBBControl/startTBB.sh b/MAC/APL/StationCU/src/TBBControl/startTBB.sh index 155f6bc383ae49654f12eae996f47b4315927f78..34cfa2ccba02879e3c5320f34fe8f0e64bbc5db0 100755 --- a/MAC/APL/StationCU/src/TBBControl/startTBB.sh +++ b/MAC/APL/StationCU/src/TBBControl/startTBB.sh @@ -6,6 +6,11 @@ # $Id:$ # +# Only in ILT mode when lofarsys controls the system +if [ "$USER" != "lofarsys" ]; then + exit +fi + level=`swlevel -S` if [ $level -lt 2 ]; then echo "Swlevel must be 2 or higher, and RSPDriver and TBBDriver must be running" diff --git a/MAC/APL/StationCU/src/TBBControl/stopTBB.sh b/MAC/APL/StationCU/src/TBBControl/stopTBB.sh index cc1f399712089f20267bf8248b47fd21f8d11420..3a8de4da1666de7e647c0e5b23754cabbdc81e75 100755 --- a/MAC/APL/StationCU/src/TBBControl/stopTBB.sh +++ b/MAC/APL/StationCU/src/TBBControl/stopTBB.sh @@ -6,6 +6,11 @@ # $Id:$ # +# Only in ILT mode when lofarsys controls the system +if [ "$USER" != "lofarsys" ]; then + exit +fi + level=`swlevel -S` if [ $level -lt 2 ]; then echo "Swlevel must be 2 or higher, and RSPDriver and TBBDriver must be running"