#!/bin/tcsh


# $1 0=all rocs  
# $2 VERSION NUMBER


if ($#argv < 2) then
    echo "CDC basline adjuster and DAC value determiner"
    echo "Insufficent parameters:"
    echo " ./startall.csh ROC VERSION"
    echo "                ROC = 0 start all ROCS"
    exit
endif

if ($1 == 0) then
    echo "Start up all CDC ROCS with version "$2" to set DAC values for baseline"
    echo "ROC 1"
    ssh hdcdcops@roccdc1 /home/hdcdcops/scripts/startupbaselineWithSearchCDC.csh 1 $2 13  \&
    echo "ROC 2"
    ssh hdcdcops@roccdc2 /home/hdcdcops/scripts/startupbaselineWithSearchCDC.csh 2 $2 12  \&
    echo "ROC 3"
    ssh hdcdcops@roccdc3 /home/hdcdcops/scripts/startupbaselineWithSearchCDC.csh 3 $2 12  \&
    echo "ROC 4"
    ssh hdcdcops@roccdc4 /home/hdcdcops/scripts/startupbaselineWithSearchCDC.csh 4 $2 13  \&

else
    echo "Start up all CDC ROC "$1" with version "$2      
   ssh -f hdcdcops@roccdc$1 /home/hdcdcops/scripts/startupbaselineWithSearchCDC.csh $1 $2 15 \&

endif
