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

SPOOLDIR=

shift               # skip faxnumber

FAXDIR=$SPOOLDIR/`basename $1`_${USER}_`date +"%d.%m.%y_%H:%M:%S"`

mkdir -p -m 0700 $FAXDIR          # make spooldirectory 

# copy faxdirectory to spooldirectory
cp $1/faxinfo $1/faxcontents $1/g3fax_* $FAXDIR  

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