summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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