Hi,
Post by Gert DoeringPost by Wouter van MarleIs this now implemented or not? The man pages are contradictory here. I
have seen both the range and the from-only option mentioned.
Any plans to have it implemented? Any patches available maybe?
The missing code is just a few lines + documentation, so I'll try to
get this done next week.
OK, here we go. This is just the faxspool + faxq patch (made against
faxspool.in / faxq.in, but should apply just fine against the resulting
scripts).
Documentation update will be done, but I won't send the patch here, do
a 1.1.37 release instead "soon".
gert
Index: faxspool.in
===================================================================
RCS file: /u2/cvs/mgetty/fax/faxspool.in,v
retrieving revision 4.35
retrieving revision 4.36
diff -u -r4.35 -r4.36
--- faxspool.in 21 Aug 2007 10:33:42 -0000 4.35
+++ faxspool.in 4 Jun 2010 12:45:36 -0000 4.36
@@ -3,7 +3,7 @@
# faxspool - sample script how to spool fax input data to a spool
# directory, creating jobs to be run by faxrunq
#
-# sccsid: $Id: faxspool.in,v 4.35 2007/08/21 10:33:42 gert Exp $ (c) Gert Doering
+# sccsid: $Id: faxspool.in,v 4.36 2010/06/04 12:45:36 gert Exp $ (c) Gert Doering
#
# syntax: faxspool [flags] <phone-number> <job(s)>
#
@@ -26,6 +26,10 @@
# 3.10.93: use "hp2hig3" for hp-pcl4-files (cl)
# 19.10.93: phone directories (caz)
# $Log: faxspool.in,v $
+# Revision 4.36 2010/06/04 12:45:36 gert
+# Implement "start-end" syntax for "-t <time>" flag
+# small bugfix for "echo" message after successful queueing "with -t"
+#
# Revision 4.35 2007/08/21 10:33:42 gert
# add "-" to list of permitted characters in FDATE
#
@@ -529,17 +533,26 @@
shift ; shift
;;
# set first time to send fax
- -t) if expr "$2" : "[0-2][0-9]:[0-9][0-9]$" >/dev/null
+ -t) if expr "$2" : "[0-2][0-9]:[0-5][0-9]$" >/dev/null
then
h=`expr "$2" : "\(..\)"`
m=`expr "$2" : "..:\(..\)"`
- if [ "$h" -gt 23 -o "$m" -gt 60 ]
+ if [ "$h" -gt 23 ]
then
$echo "Invalid time specified: $h:$m" >&2; exit 2
fi
TIME="$h$m"
+ elif expr "$2" : "[0-2][0-9]:[0-5][0-9]-[0-2][0-9]:[0-5][0-9]$" >/dev/null
+ then
+ h1=`expr "$2" : "\(..\)"`
+ h2=`expr "$2" : "..:..\-\(..\)"`
+ if [ "$h1" -gt 23 -o "$h2" -gt 23 ]
+ then
+ $echo "Invalid time range specified: $2" >&2; exit 2
+ fi
+ TIME="`echo "$2" | tr -d ':'`"
else
- $echo "Time must be in <hh:mm> format." >&2; exit 2
+ $echo "Time specification (-t) must be in <hh:mm> or <hh:mm-hh:mm> format." >&2; exit 2
fi
shift ; shift
;;
@@ -995,6 +1008,6 @@
if [ -z "$TIME" ] ; then
$echo "\nFax queued successfully. Will be sent at next \`\`faxrunq'' run.\n"
else
- $echo "\nFax queued successfully. Will be sent at first \`\`faxrunq'' run\nafter the specified send time '$TIME' has been reached\n."
+ $echo "\nFax queued successfully. Will be sent at first \`\`faxrunq'' run\nafter the specified send time '$TIME' has been reached.\n"
fi
fi
Index: faxq.in
===================================================================
RCS file: /u2/cvs/mgetty/fax/faxq.in,v
retrieving revision 4.11
retrieving revision 4.12
diff -u -r4.11 -r4.12
--- faxq.in 16 Apr 2005 11:29:09 -0000 4.11
+++ faxq.in 4 Jun 2010 12:42:54 -0000 4.12
@@ -4,7 +4,7 @@
#
# like "lpq" or "mailq", show jobs waiting in the output queue
#
-# SCCS: $Id: faxq.in,v 4.11 2005/04/16 11:29:09 gert Exp $ Copyright (C) 1994 Gert Doering
+# SCCS: $Id: faxq.in,v 4.12 2010/06/04 12:42:54 gert Exp $ Copyright (C) 1994 Gert Doering
#
FAX_SPOOL=@FAX_SPOOL@
FAX_SPOOL_OUT=@FAX_SPOOL_OUT@
@@ -127,8 +127,11 @@
$1=="acct_handle" \
{ printf "ACCT=\"%s\";", substr( $0, 13 ) }
$1=="input" { printf "INPUT=\"%s\";", substr( $0, 7 ) }
- $1=="time" { printf "TIME=\"%s:%s\";",
- substr( $0, 6, 2 ), substr( $0, 8,2 ) }
+ $1=="time" { if ( length($2) == 4 )
+ { printf "TIME=\"%s:%s\";",
+ substr( $2, 1, 2 ), substr( $2, 3, 2 ) }
+ else
+ { printf "TIME=\"%s\";", $2 } }
$1=="subject"{ printf "RE=\"%s\";", substr( $0, 9 ) }
$1=="priority"{ printf "PRI=\"%s\";", $2 }
$1=="pages" { if ( NF==2 ) printf "PAGES=\"%s\";", $2
--
USENET is *not* the non-clickable part of WWW!
//www.muc.de/~gert/
Gert Doering - Munich, Germany ***@greenie.muc.de
fax: +49-89-35655025 ***@net.informatik.tu-muenchen.de
--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de