#!/bin/bash #set -x if [ $# -ne 3 ] then echo "Usage: faxit " exit fi device=$1 faxnum=$2 file=$3 /usr/local/bin/a2ps \ -F13 -f -p -nd -ns \ -H"StockTrade Alert" \ $file > ${file}.ps /usr/bin/gs \ -sDEVICE=faxg3 \ -sOutputFile=${file}.g3 \ -dSAFER \ -dNOPAUSE \ -dQUIET \ ${file}.ps < /dev/null >> /etc/gsm/gs.log 2>&1 /usr/sbin/sendfax \ -D ATX3DT \ -l $device \ -m X3 \ -x 5 \ $faxnum \ ${file}.g3 < /dev/null >> /etc/gsm/fax.log 2>&1 result=$? rm ${file} rm ${file}.ps rm ${file}.g3 exit $result