#!/bin/bash

MINBIN=/usr/local/minerva/bin
FILENAME=$2
VARLOG=/var/log/minerva

date +"%F %H:%M CMD $0 $*" >>$VARLOG/bearskin/`basename $0`


DEVICE=`$MINBIN/finddev say $*`
if [ $? == 0 ]; then
  echo $DEVICE
  exit 0;
fi

if [ -f "$FILENAME" ]; then
  festival --tts $FILENAME
  exit 0;
fi

exit 1;

