LAST=etc/lastrun # file where time+date of last run recorded
cd @SPOOL@ # NB: everything below assumes this
+. bin/common-functions
test -f etc/setup.cache || {
SPOOL=`pwd`
startup a server system.
EOF
- exit 1
+ hfExit 1
}
. etc/setup.cache
UPDATE="date +'%D %H:%M' >$LAST"
# security
-TMPDIR=`(mktemp -d /tmp/.faxcron.XXXXXX) 2>/dev/null`
-if test X$TMPDIR = X; then
- TMPDIR=/tmp/.faxcron$$
-fi
-@RM@ -fr $TMPDIR
-(umask 077 ; mkdir $TMPDIR) || exit 1
+SetupPrivateTmp
JUNK=$TMPDIR/faxjunk$$ # temp file used multiple times
AWKTMP=$TMPDIR/faxawk$$ # temp file for awk program
-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]"; exit 1;;
+ -*) echo "Usage: $0 [-n] [-l lastrun] [-info days] [-log days] [-rcv days] [-tmp days] [-mode logmode]"; hfExit 1;;
esac
shift
done
-trap "$RM \$AWKTMP \$JUNK; $RM -rf $TMPDIR; exit 1" 1 2 15
-
-
test -z "$LASTRUN" && LASTRUN=`$CAT $LAST 2>/dev/null`
echo "Facsimile transmitted since $LASTRUN:"
$RM $LAST; eval $UPDATE
# cleanup
-$RM $AWKTMP $JUNK; $RM -rf $TMPDIR
-exit 0
+hfExit 0
# OF THIS SOFTWARE.
#
+. bin/common-functions
+
#
# faxrcvd file devID commID error-msg
#
if [ $# -lt 4 ]; then
echo "Usage: $0 file devID commID error-msg [ callID-1 [ callID-2 [ ... [ callID-n ] ] ] ]"
- exit 1
+ hfExit 1
fi
test -f etc/setup.cache || {
startup a server system.
EOF
- exit 1
+ hfExit 1
}
# These settings may not be present in setup.cache if user upgraded and
TTYCMD=tty
. etc/setup.cache
-. bin/common-functions
INFO=$SBIN/faxinfo
FAX2PS=$TIFFBIN/fax2ps
# whitespace; in that case a separate attachment for each filetype
# will be created.
+. bin/common-functions
+
if [ $# != 3 ] && [ $# != 4 ]; then
echo "Usage: $0 qfile why jobtime [nextTry]"
- exit 1
+ hfExit 1
fi
test -f etc/setup.cache || {
startup a server system.
EOF
- exit 1
+ hfExit 1
}
# need to parse out the command line here. some may be needed
TTYCMD=tty
. etc/setup.cache
-. bin/common-functions
INFO=$SBIN/faxinfo
TIFFINFO=tiffinfo
# OF THIS SOFTWARE.
#
+. bin/common-functions
+
#
# pollrcvd mailaddr faxfile devID commID error-msg
#
if [ $# != 5 ]
then
echo "Usage: $0 mailaddr faxfile devID commID error-msg"
- exit 1
+ hfExit 1
fi
test -f etc/setup.cache || {
startup a server system.
EOF
- exit 1
+ hfExit 1
}
# These settings may not be present in setup.cache if user upgraded and
TTYCMD=tty
. etc/setup.cache
-. bin/common-functions
INFO=$SBIN/faxinfo
FAX2PS=$TIFFBIN/fax2ps
# Print Statistics about Received Facsimile.
#
SPOOL=@SPOOL@
+. $SPOOL/bin/common-functions
test -f $SPOOL/etc/setup.cache || {
cat<<EOF
startup a server system.
EOF
- exit 1
+ hfExit 1
}
. $SPOOL/etc/setup.cache
-since) shift; SINCEDT=$1;;
-end) shift; ENDDT=$1;;
-*) echo "Usage: $0 [-sortkey] [-age days] [-since date] [-end date] [files]"
- exit 1
+ hfExit 1
;;
*) FILES="$FILES $1";;
esac
#
# Generate an awk program to process the statistics file.
#
-TMPDIR=`(mktemp -d /tmp/.recvstats.XXXXXX) 2>/dev/null`
-if test X$TMPDIR = X; then
- TMPDIR=/tmp/.recvstats$$
-fi
-@RM@ -fr $TMPDIR
-(umask 077 ; mkdir $TMPDIR) || exit 1
+SetupPrivateTmp
tmpAwk=$TMPDIR/xferfax$$
-trap "@RM@ -f $tmpAwk; @RM@ -fr $TMPDIR; exit 1" 1 2 15
($CAT<<'EOF'
#
$AWK -f $tmpAwk -v TODAY="$TODAY" -v AGE="$AGE" -v SINCEDT="$SINCEDT" -v ENDDT="$ENDDT" $FILES
# cleanup
-@RM@ -f $tmpAwk; @RM@ -fr $TMPDIR
-exit 0
+hfExit 0
# Print Statistics about Transmitted Facsimile.
#
SPOOL=@SPOOL@
+. $SPOOL/bin/common-functions
test -f $SPOOL/etc/setup.cache || {
cat<<EOF
startup a server system.
EOF
- exit 1
+ hfExit 1
}
. $SPOOL/etc/setup.cache
-age) shift; AGE=$1;;
-since) shift; SINCEDT=$1;;
-end) shift; ENDDT=$1;;
- -*) echo "Usage: $0 [-sortkey] [-age days] [-since date] [-end date] [-nomap] [files]"; exit 1;;
+ -*) echo "Usage: $0 [-sortkey] [-age days] [-since date] [-end date] [-nomap] [files]"; hfExit 1;;
*) FILES="$FILES $1";;
esac
shift
#
# Generate an awk program to process the statistics file.
#
-TMPDIR=`(mktemp -d /tmp/.xferfaxstats.XXXXXX) 2>/dev/null`
-if test X$TMPDIR = X; then
- TMPDIR=/tmp/.xferfaxstats$$
-fi
-@RM@ -fr $TMPDIR
-(umask 077 ; mkdir $TMPDIR) || exit 1
+SetupPrivateTmp
tmpAwk=$TMPDIR/xferfax$$
-trap "@RM@ -fr $TMPDIR; exit 1" 1 2 15
($CAT<<'EOF'
#
$AWK -f $tmpAwk -v TODAY="$TODAY" -v AGE="$AGE" -v SINCEDT="$SINCEDT" -v ENDDT="$ENDDT" $FILES
# cleanup
-@RM@ -fr $TMPDIR
-exit 0
+hfExit 0