From 8c3ebe0dcb653f06f9b93063f2af3826ffc08a6d Mon Sep 17 00:00:00 2001 From: lhdamiani Date: Thu, 15 Apr 2021 16:56:03 +0200 Subject: [PATCH] script virtual eiger start --- eiger/control/start_virtual_eiger.sh | 55 ++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100755 eiger/control/start_virtual_eiger.sh diff --git a/eiger/control/start_virtual_eiger.sh b/eiger/control/start_virtual_eiger.sh new file mode 100755 index 0000000..ee4019b --- /dev/null +++ b/eiger/control/start_virtual_eiger.sh @@ -0,0 +1,55 @@ +#!/bin/bash + +MAKE_FLAG=0 +MASTER='/home/hax_l/software/sf_daq_buffer/slsDetectorPackage/build/bin/eigerDetectorServerMaster_virtual' +SLAVE='/home/hax_l/software/sf_daq_buffer/slsDetectorPackage/build/bin/eigerDetectorServerSlaveBottom_virtual' +DET_PUT='/home/hax_l/software/sf_daq_buffer/slsDetectorPackage/build/bin/sls_detector_put' +CONFIG_FILE='/home/hax_l/software/sf_daq_buffer/eiger/config/config_eiger.txt' + +HELP_FLAG=0 +PORT_MASTER=2050 +while getopts h:p:c: flag +do + case "${flag}" in + h ) HELP_FLAG=${OPTARG};; + p ) PORT_MASTER=${OPTARG};; + c ) CONFIG_FILE=${OPTARG};; + esac +done + +PORT_SLAVE=$(( $PORT_MASTER + 2 )) + + +# prints help and exits +if (( ${HELP_FLAG} == 1 )); then + echo "Usage : $0 -c -h " + echo " port : port connection for master virtual eiger." + echo " config_file : detector configuration file." + echo " help_flag : show this help and exits." + exit +fi + + +# proceeds to start the receivers +echo "Starting the virtual eiger (master and slave) (config file: ${CONFIG_FILE})" +if [ -f "${MASTER}" ]; then + if [ -f "${MASTER}" ]; then + if [ -f "${CONFIG_FILE}" ]; then + ${MASTER} -p ${PORT_MASTER} & + sleep 1 + ${SLAVE} -p ${PORT_SLAVE} & + sleep 1 + ${DET_PUT} config ${CONFIG_FILE} + else + echo "Something went wrong with the config file..." + exit + fi + fi +else + echo "Something went wrong with the virtual eiger executable..." + exit +fi + + + +