#! /bin/sh
#
# Read Voltage Sensors 
# Note that it kills feeserver

echo -n "Sending command to all DCSs."

TEMP_PREFIX=temp_read_voltage_

POS_LIST="1_0_0 1_1_0 1_0_1 1_1_1 1_0_2 1_1_2 1_0_3 1_1_3 1_0_4 1_1_4 1_0_5 1_1_5"


for P in $POS_LIST ; do
    DCS=`./modules/getdcsbypos.pl $P`
    ssh $DCS "killall -q feeserver; /dcsnfs/dietel/adc/volt -n 1 -s 1" > $TEMP_PREFIX$P 2>&1 & < /dev/null
    echo -n "."
done

echo ""
wait

for P in $POS_LIST ; do
    DCS=`./modules/getinfobypos.pl $P dcs`
    echo -n "$P $DCS :"
    cat $TEMP_PREFIX$P
    rm -rf $TEMP_PREFIX$P
done
