@@ -88,21 +88,21 @@ cd /reg/g/pcds/dist/pds/"$HUTCH"/scripts/ || exit
8888DAQNETWORK=' fez'
8989PROCMGR=" /reg/g/pcds/dist/pds/$HUTCH /current/tools/procmgr/procmgr"
9090
91- if [ " $IS_DAQ_HOST " == 0 ]; then
92- # There is currently no suitable way to find daq-compatible hosts in sdfconfig
93- # Maybe this will work in the future, disable for now and have worse UX
94- # HOSTS=$(sdfconfig search --type subnet PCDSN-${DAQNETWORK^^}-${HUTCH^^} --brief)
95- # WORKINGHOSTS=''
96- # #make sure at least cds is up.
97- # for HOST in $HOSTS; do
98- # if [[ $(ping -w 2 "$HOST" >/dev/null 2>&1) == 0 ]]; then
99- # WORKINGHOSTS=$WORKINGHOSTS' '$ HOST
100- # fi
101- # done
102- # Placeholder less useful message:
103- echo " $AIMHOST " does not have " $DAQNETWORK " , please choose a server with " $DAQNETWORK "
104- # echo "$AIMHOST" does not have "$ DAQNETWORK" , please choose one of the following machines to run the DAQ: "$ WORKINGHOSTS"
105- echo " restartdaq -m <machine_with_$DAQNETWORK >"
91+ if [ " ${ IS_DAQ_HOST} " == 0 ]; then
92+ HOSTS= " $( sdfconfig search --brief --type subnet PCDSN- " ${DAQNETWORK^^} " - " ${HUTCH^^} " ) "
93+ WORKINGHOSTS= " "
94+ for HOST in $HOSTS ; do
95+ # Only consider hosts that start with hutch-, e.g. xpp-control, xcs-daq
96+ if [[ " ${HOST} " == " ${HUTCH} " - * ]] ; then
97+ # Make sure cds intf is up via ping
98+ # Remove trailing .pcdsn to switch from fqdn to hostname
99+ if ping -w 2 " ${ HOST% .pcdsn} " & > /dev/null ; then
100+ WORKINGHOSTS= " ${WORKINGHOSTS} ${HOST % .pcdsn} "
101+ fi
102+ fi
103+ done
104+ echo " ${ AIMHOST} does not have ${ DAQNETWORK} , please choose one of the following machines to run the DAQ:${ WORKINGHOSTS} "
105+ echo " restartdaq -m <machine_with_${ DAQNETWORK} >"
106106 exit
107107fi
108108
0 commit comments