off all
killall dtsx
dtsxinit
image=`basename $1`
port=5034
rm get_fbcpld_results.txt
while [ $port -lt 5065 ]; do
	num=`expr $port - 5001`
	card=`expr $num / 8`
	pair=`expr $num % 8`
	pair=`expr $pair / 2`
	dom=`expr $num % 2` 
	if [ $dom -eq 0 ]; then
		dom=A
	elif [ $dom -eq 1 ]; then
		dom=B
	fi
        echo checking for dhc${card}w${pair}d${dom} port $port: >> get_fbcpld_results.txt
	tail -n1 get_fbcpld_results.txt
	get_fbcpld.py $port >> get_fbcpld_results.txt
	tail -n1 get_fbcpld_results.txt 
	port=`expr $port + 1`
	if [ $dom == B ]; then
	 echo off $card $pair 
	 off $card $pair 
        fi
done
off all
