HylaFAX The world's
most advanced open source fax server
|
|
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
Re: [hylafax-users] FAX RESEND ?
On Mon, 28 Oct 2002, Eric Wood wrote:
> I would imagine that you would have to write a shell script to do this:
>
> Parse the fax number, mailaddr, out of the q file and do a sendfax using
> the already generated .ps file.
>
> ----- Original Message -----
> From: "Alex" <faxuser@cesena.net>
> >
> > How can I re-send a fax that has failed or removed from queue?
> > I still have .ps and q file in docq and doneq.
Attached is a quick k-shell script I created many moons ago for an older
version of HylaFAX. It might need some tweaking for the latest HylaFAX
version, but it should be pretty close to what you need.
--
Ed Bond <ed@bmsi.com>
#!/bin/sh
echo DEFANGED.195
exit
#!/bin/sh
echo DEFANGED.5
exit
#!/bin/sh
echo DEFANGED.196
exit
#!/bin/ksh
usage() {
cat <<EOF
Usage: faxreque [-r jod_id job_id | job_id [job_id ...] ]
Description:
Resubmits a HylaFAX job that is still in the doneq.
Use -r option to submit a range.
EOF
exit
}
test $# -gt 0 || usage
umask 0
# Change to HylaFAX directory
FAXDIR=/var/spool/fax
cd $FAXDIR
# Set killtime to now + 24 hours
killtime=`date +%s`
let killtime+=86400
reque() {
file=q$1
dfile=doneq/$file
if test -w $dfile -a -r $dfile
then
# Reset fax parameters
if ed <<EOF >/dev/null 2>&1
r $dfile
/^killtime:/s/:.*/:$killtime/
/^totdials:/s/:.*/:0/
/^tottries:/s/:.*/:0/
/^state:/s/:.*/:1/
w
q
EOF
then
mv $dfile sendq
echo S$1 >FIFO # Tell hfaxd to send it
else
echo "$0: error modifying $dfile."
fi
else
echo "$0: $dfile is not accessible."
fi
}
if test "$1" = '-r'
then
test $# -eq 3 || usage
test "$3" -gt "$2" || usage
i=$2
while test $i -le $3
do
reque $i
let i+=1
done
else
for i
do
reque $i
done
fi