#!/bin/bash
#
# start up testdaq
# M Krasberg, U of Wisconsin
#

rmis=`ps -ef | grep rmiregistry -c`
while [ ${rmis} -gt 1 ]; do
  echo "rmiregistry already running - did you issue command 'stoptestdaq'?"
  echo "rmiregistry already running - did you issue command 'stoptestdaq'?"
  echo ' you should hit ^C, then issue command "stoptestdaq" and try again...'
  sleep 999999999
done

echo "1" > $HOME/bin/.checklogscounter

cd $HOME
#wall starting testdaq scripts up on `head /usr/local/etc/.domhub_name` ...
killall rmiregistry
#killall cat
nohup automate $* &
#echo " " >> $HOME/output/testdaq.log
#nohup /usr/local/bin/watch.pl &
sleep 12
#tail -f $HOME/output/testdaq.log
echo " you should do tail -f outputXXXXXXX/testdaq.log , unfortunately this program does not know what the runnumber will be "

