Shell Variable available within Samba "print command"
I am using the "printpdf" shell below and it is working well. Except I would like a better naming convention for outpout PDF files.
Is there a Shell variable within the SAMBA PRINT COMMAND environment I can use to identify the PRINT REQUESTER PC NAME or TCPIP address, anything unique to the requester ID. My final result of printpdf wouldbe:
"Joe date H M S.pdf"
or "10.1.1.120 date H M S.pdf"
instead of "date H M S.pdf"
I am currently using "FileName" variable in the shell...
/////////////// my Samba setup ////////////
//// statement in smb.conf //////
comment = SambaOne PDF Printer Documents
path = /mnt/pdfdocs
writeable = yes
guest ok = yes
; Set up our PDF-creation print service
path = /tmp
printable = yes
guest ok = yes
print command = /usr/bin/printpdf %s
lpq command =
lprm command =
//////////// PRINTPDF SHELL COMMAND called by SAMBA PRINT COMMAND
# ////// printpdf shell program /////
# script to convert a specified postscript file into a PDF
# and place it in a location that is shared by the Samba server.
# 1st - The name of the spool file
# John Bright, 2001, jbright winfordeng com
# create the pdf into a temporary file based on current date and time.
# After we are finished, rename it same date, but ending
# in .pdf. We do this because if a user tries to open a PDF that is
# still being written, they will get a message that it is corrupt,
# when it is actually just not done yet.
FileName =`date +%b%d-%H%M%S`
ps2pdf $1 $OUTDIR/$FileName.temp
mv $OUTDIR/$FileName.temp $OUTDIR/$FileName.pdf