summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2002-07-09 02:52:09 +0000
committerJonas Smedegaard <dr@jones.dk>2002-07-09 02:52:09 +0000
commit38499aff2629192e9faff9d48f66b8361e6b7161 (patch)
treeefb9ba8556578dc3abdeaa350aba9869ecbe04d7
parentced79cee6f9fd110c2febb98228c9afbd64f489e (diff)
Email pdf output if either mime-construct or mimeit (metamail) is installed and username provided. Include timestamp even if no username (and properly check for username, not jobname).
-rwxr-xr-xpdfdistiller12
1 files changed, 9 insertions, 3 deletions
diff --git a/pdfdistiller b/pdfdistiller
index 96dec21..6c13286 100755
--- a/pdfdistiller
+++ b/pdfdistiller
@@ -47,8 +47,8 @@ echo "PDF directory: $PDFDIR" >> $LOGFILE
# generate output filename
OUTPUTFILENAME=
-if [ "$3" = "" ]; then
- OUTPUTFILENAME="$PDFDIR/unknown.pdf"
+if [ "$2" = "" ]; then
+ OUTPUTFILENAME="$PDFDIR/unknown-$PRINTTIME.pdf"
else
# OUTPUTFILENAME="$PDFDIR/${3//[^[:alnum:]]/_}.pdf"
# I changed this to user name, and the printtime to track down who
@@ -73,7 +73,13 @@ fi
# - owns to user specified in argument
chmod a+r $OUTPUTFILENAME
if [ "$2" != "" ]; then
- chown $2 $OUTPUTFILENAME
+ if [ -x /usr/bin/mime-construct ]; then
+ /usr/bin/mime-construct --to "$2" --subject "PDF print" --type application/pdf --file $OUTPUTFILENAME
+ elif [ -x /usr/bin/mimeit ]; then
+ cat $OUTPUTFILENAME | /usr/bin/mimeit application/pdf $2 "PDF print"
+ else
+ chown $2 $OUTPUTFILENAME
+ fi
fi
exit 0