Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 #! /bin/sh
0002 
0003 # this is an example script that is meant to be added as a device_command.
0004 
0005 # We show how we are adding a previously generated image to an 
0006 # existing elog entry as an attachment. It shows the use of the environmental variables
0007 # which cdaq defines for the use in such scripts. 
0008 
0009 # if elog is not defined, we do nothing
0010 [ -z "$DAQ_ELOGHOST ] && exit
0011 
0012 [ -f $HOME/snapshot.jpg ] || exit
0013 
0014 
0015 if elog -h $DAQ_ELOGHOST  -p $DAQ_ELOGPORT -l $DAQ_ELOGLOGBOOK -w last | grep -q "Run.*started" 
0016 then
0017 
0018     # we get the last entry id
0019     LASTID=$(elog -h $DAQ_ELOGHOST  -p $DAQ_ELOGPORT -l $DAQ_ELOGLOGBOOK -w last | head -n 1 | awk '{print $NF}')
0020     
0021     elog -h $DAQ_ELOGHOST  -p $DAQ_ELOGPORT -l $DAQ_ELOGLOGBOOK -e $LASTID -f $HOME/snapshot.jpg > /dev/null 2>&1
0022 
0023 fi
0024