#!/bin/sh

bindir=/usr/bin
SCRIPTPATH="$(dirname "$0")"

# If running the script from the scripts directory for testing, use the dev
# binary, not the one installed
if [ -e $SCRIPTPATH/../modemu2k ]; then
  bindir=$SCRIPTPATH"/.."
  echo "Using $bindir/modemu2k for testing..."
  echo "Press a key to continue..."
  read k
fi

$bindir/modemu2k -e "AT%B0=1%B1=1&W" -c "minicom -l -tansi -con -p %s"

cd $savedir

exit $?
