Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-02 08:21:08

0001 #! /bin/sh
0002 
0003 # we wait for the end of the run or at most n seconds, if specified 
0004 
0005 if ! rcdaq_client daq_status -s > /dev/null 2>&1 ; then
0006     exit 1;
0007 fi
0008 
0009 
0010 MAX_TIME=$1
0011 
0012 [ -z "$MAX_TIME" ] && MAX_TIME=0
0013 
0014 # we record the start time 
0015 START=$(date +%s)
0016 
0017 while true; do 
0018 
0019     if [ $MAX_TIME -gt 0 ] ; then
0020         NOW=$(date +%s)
0021         DELTA=$(expr $NOW - $START)
0022         #echo "$START $NOW $DELTA"
0023         [ $DELTA -ge $MAX_TIME ] && exit 1 
0024     fi
0025 
0026     S=$(rcdaq_client daq_status -s 2>/dev/null | awk '{print $1}')
0027 #    echo $S
0028 
0029     [ -z "$S" -o "$S" = "-1" ] && exit 0
0030     sleep 2
0031 
0032 done
0033 
0034  
0035