Hylafax Mailing List Archives
|
[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
Re: faxrcvd script does not work
Hey,
i modified faxrcvd this way:
...
. etc/setup.cache
CHMOD=/bin/chmod
INFO=$SBIN/faxinfo
FAX2PS=/usr/bin/tiff2ps
PS2PDF=/usr/bin/ps2pdf
CAT=/bin/cat
TOADDR=FaxMaster
COPY=/bin/cp
...
if [ -f $FILE ]; then
#
# Check the sender's TSI and setup to dispatch
# facsimile received from well-known senders.
#
SENDER="`$INFO $FILE | $AWK -F: '/Sender/ { print $2 }' 2>/dev/null`"
AUNAME="`date +%b-%d-%a-%H.%MUhr`"
$FAX2PS -a $FILE > /var/spool/fax/recvq/tmp.ps
$PS2PDF /var/spool/fax/recvq/tmp.ps /var/spool/fax/recvq/$AUNAME.pdf
$CHMOD 0666 /var/spool/fax/recvq/$AUNAME.pdf
$COPY /var/spool/fax/recvq/$AUNAME.pdf /datfax/fax/$AUNAME.pdf
$CHMOD 0666 /datfax/fax/$AUNAME.pdf
...
this converts the tif file into a temporary ps file, than converts into pdf,
changes permissions and makes a copy of the pdf document to another location.
the name of the pdf file consists of the date and time of receiving.
another point to a solution would be to run a cron job and to use a
shellscript, which uses the find command to copy the files in the recvq dir to
the right directories (and to make the directories)
i hope it helps!
Greetings Torsten
Mark schrieb:
> Hi,
>
> try using absolute pathnames in your script. I seem to recall that the
> hylafax programs use "chroot". Also, put "set -x" at the top of the script
> for debug output.
>
> Best Regards,
>
> Mark Wilson
>
> P. Kay Associates Ltd.
>
> On Wed, 5 Jan 2000, Ertan Kucukoglu wrote:
>
> > Hello,
> >
> > I have 4.0pl2 version of Hylafax. and FreeBSD 3.3 OS.
> >
> > I tried to move incoming faxes from recvq dir to somewhere else. I had
> > to write one program. That program checkes if the given directories are
> > present. If not it creates them and returns 0 on success other number on
> > fail. My directory tree likes that:
> >
> > bash-2.03$ cd /var/spool/fax/bin/
> > bash-2.03$ ls
> > faxrcvd mymkdir pollrcvd ps2fax.imp
> > faxrcvd.bak notify ps2fax tiff2fax
> > faxrcvd~ notify.awk ps2fax.dps token
> > mkcover pcl2fax ps2fax.gs wedged
> >
> > And I changed the script as below:
> > bash-2.03$ cat faxrcvd
> > #! /bin/sh
> >
> > FILE="$1"
> >
> > if [ -f $FILE ]; then
> > A=`date '+%Y/%m/%d'`
> > echo "Dizinler kontrol ediliyor..."
> > if bin/mymkdir fakslar `date '+%Y'` `date '+%m'` `date '+%d'`; then
> > # MYFILE=recvq/`token $FILE`
> > echo "Dosya adi: $FILE"
> > echo "Tasindigi yer: $A"
> > mv $FILE fakslar/$A/
> > fi
> > fi
> > bash-2.03$
> >
> > The fakslar directory is a link to somewhere under my ftp directory.
> > bash-2.03$ ls -l /var/spool/fax/fakslar
> > lrwxr-xr-x 1 root dialer 12 Jan 4 16:01 /var/spool/fax/fakslar ->
> > /ftp/fakslar
> > bash-2.03$
> >
> > I send a fax to myself and it did not move the required files. If I run
> > the script by hand it runs and does its job.
> >
> > I replace the old sript file and put my script at the end of the
> > original script. Tried to send a fax to myself and:
> > 1. I receive 'fax received from' mail delivered.
> > 2. My script does not work.
> >
> > Any ideas about that?
> >
> > --
> > Ertan Kucukoglu
> > ertank@ozlerplastik.com
> >
> > P.S. Sorry for this slightly long mail and for my English.
> >