#!/bin/sh
#
# docview, Copyright 1997 S.u.S.E. GmbH, Fuerth
# Author Carsten Hoeger, Carsten.Hoeger@suse.de
#
# this script converts a tiffg3 fax received from hfaxd
# into Postscript via tiff2ps and opens gv or ghostview
# to view it
#

FAX2PS=/usr/bin/tiff2ps


test -f $FAX2PS || {
    cat<<EOF

This script requires the libtiff-package with at least
version 3.4b35 to be installed, which includes
$FAX2PS!!!

EOF
    exit 1
}

if [ -f /usr/X11R6/bin/gv ]; then
    VIEWER="/usr/X11R6/bin/gv"
elif [ -f /usr/X11/bin/ghostview ]; then
    VIEWER=ghostview
else
    cat<<EOF

You need either /usr/X11/bin/gv (package gv) or
/usr/X11/bin/ghostview (package gsview) to be installed
or you have to change this script... :-)

EOF
fi

$FAX2PS -p -a -O $1.ps $1 && $VIEWER $1.ps
#rm -f $1.ps
#rm -f $1
