Thanks!
if [ `echo $2 | grep -ce "\.[Pp][Dd][Ff]"` -le 0 ]
> then
> echo `date` " - ERR: This scripts accepts only PDF format as
> input file!!! ($2)" >> $LOGFILE 2>&1
> exit 1
> fi
This is IMO too Windows-like -- just relying on a filename to guess
content. I'd do it like this:
if [ "$(file -bi $2)" = "application/pdf" ] ...
--D.
I'll update the script.
Anyway, it seems that is possible to do the same thing working directly on
the 'gs' string in the /etc/cups/cups-pdf.conf, in the section 'GSCall'.
Infact i find out that a sintax like "gs watermark_file.ps file.ps" do the
same as the script above.
I'll try also this way.
Regards