#!/bin/sh

bt_read=`which bt_read`
sz=`cat /proc/btrax/subbuf_size`
sn=`cat /proc/btrax/n_subbufs`
terminate=

if [ $# -ge 3 ]; then
	terminate="-T"
fi
if [ ! -x $bt_read ]; then
	echo "bt_read command not found"
	exit 1
fi
if [ ! -d $1 ]; then
	echo "input directory not found"
	exit 1
fi
if [ ! -d $2 ]; then
	echo "output directory not found"
	exit 1
fi

#rm -rf $2
$bt_read $terminate -s $sz -n $sn -i $1 -o $2
