#!/bin/sh
# 
# Modified fax script for use with Xfax
#

FAXSPOOL=/var/spool/fax

shift               # skip faxnumber
# mv $1 $FAXSPOOL   # alternative: mv complete faxdirectory to spooldirectory

cp -r $1 $FAXSPOOL  # copy faxdirectory to spooldirectory

FAXDIR=$FAXSPOOL/`basename $1`

if [ -d $FAXDIR ]; then
   echo "Your faxmessage in $FAXDIR is queued for delivery."
   rm -rf $1
else
   echo "Can't queue faxmessage: Please check if the faxserver is installed,"
   echo "or use a direct faxcommand like 'faxdirect'."
fi
