#!/bin/sh
#
# This script is a wrapper to call the correct faxsend
# program, depending of the modem type
#
PARA=$*
SENDFAX=/usr/lib/fax/faxsend

m_found="no"
while [ $# -gt 0 ]; do
    case $1 in
	"-m")
	    m_found="yes"
	    ;;
	faxCAPI*)
	    if [ "$m_found" = "yes" ]; then
		SENDFAX=/usr/bin/c2faxsend
	    fi
	    m_found="no"
	    ;;
	*)
	    m_found="no"
	    ;;
    esac
    shift
done

$SENDFAX $PARA
