![]() |
Tomas Novosad wrote:I guess, i'll do my own howskeepeng script for 2ndfax, but i was just curious, why nearly every binary of hylafax is capable
to accept SPOOL as cmdline option, but faxcron not ?
diff -Nru hylafax.orig/man/faxcron.1m hylafax/man/faxcron.1m --- hylafax.orig/man/faxcron.1m 2008-10-12 21:15:07.605410336 -0700 +++ hylafax/man/faxcron.1m 2008-10-12 21:56:10.604977488 -0700 @@ -101,6 +101,9 @@ .IR date (1) format string ``%D %H:%M''). .TP 10 +.BI \-q " spool" +Specify the location of the \*(Fx spool directory. +.TP 10 .BI \-info " n" Set the expiration time for data in the info database to be .I n diff -Nru hylafax.orig/util/faxcron.sh.in hylafax/util/faxcron.sh.in --- hylafax.orig/util/faxcron.sh.in 2008-10-12 21:15:07.512424472 -0700 +++ hylafax/util/faxcron.sh.in 2008-10-12 21:38:04.216133696 -0700 @@ -42,11 +42,30 @@ AGERCV=7 # purge received facsimile after 7 days AGETMP=1 # purge orphaned temp files after 1 day FAXUSER=@FAXUID@ # owner of log files +SPOOL=@SPOOL@ # HylaFAX spool directory LOGMODE=0644 # mode for log files XFERLOG=etc/xferfaxlog # HylaFAX xferfaxlog file location LAST=etc/lastrun # file where time+date of last run recorded -cd @SPOOL@ # NB: everything below assumes this +TEE=tee +UPDATE="date +'%D %H:%M' >$LAST" + +while [ x"$1" != x"" ] ; do + case $1 in + -n) RM=":" TEE=":" CP=":" MV=":" CHOWN=":" CHMOD=":" UPDATE=":";; + -l) shift; LASTRUN="$1";; + -q) shift; SPOOL="$1";; + -info) shift; AGEINFO="$1";; + -log) shift; AGELOG="$1";; + -rcv) shift; AGERCV="$1";; + -tmp) shift; AGETMP="$1";; + -mode) shift; LOGMODE="$1";; + -*) echo "Usage: $0 [-n] [-l lastrun] [-q spool] [-info days] [-log days] [-rcv days] [-tmp days] [-mode logmode]"; hfExit 1;; + esac + shift +done + +cd $SPOOL # NB: everything below assumes this . bin/common-functions test -f etc/setup.cache || { @@ -66,8 +85,6 @@ . etc/setup.cache RM="$RM -f" -TEE=tee -UPDATE="date +'%D %H:%M' >$LAST" # security SetupPrivateTmp @@ -75,20 +92,6 @@ JUNK=$TMPDIR/faxjunk$$ # temp file used multiple times AWKTMP=$TMPDIR/faxawk$$ # temp file for awk program -while [ x"$1" != x"" ] ; do - case $1 in - -n) RM=":" TEE=":" CP=":" MV=":" CHOWN=":" CHMOD=":" UPDATE=":";; - -l) shift; LASTRUN="$1";; - -info) shift; AGEINFO="$1";; - -log) shift; AGELOG="$1";; - -rcv) shift; AGERCV="$1";; - -tmp) shift; AGETMP="$1";; - -mode) shift; LOGMODE="$1";; - -*) echo "Usage: $0 [-n] [-l lastrun] [-info days] [-log days] [-rcv days] [-tmp days] [-mode logmode]"; hfExit 1;; - esac - shift -done - test -z "$LASTRUN" && LASTRUN=`$CAT $LAST 2>/dev/null` echo "Facsimile transmitted since $LASTRUN:"