summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcups-pdf.postprocessing.sh40
1 files changed, 40 insertions, 0 deletions
diff --git a/cups-pdf.postprocessing.sh b/cups-pdf.postprocessing.sh
new file mode 100755
index 0000000..9c6b2dd
--- /dev/null
+++ b/cups-pdf.postprocessing.sh
@@ -0,0 +1,40 @@
1#!/bin/sh
2: This script allows a shared network PDF printer to be
3: used to send documents to the default printer.
4: That way, clients do not need to install the
5: printer-specific driver that would be needed if the
6: default printer were shared directly. Only the standard
7: cups PDF printer driver is needed.
8
9: To use:
10:
11: 1. Copy this file to '/etc/cups/cups-pdf.postprocessing.sh'
12:
13: 2. Add the following line to '/etc/cups/cups-pdf.conf' : \
14PostProcessing /etc/cups/cups-pdf.postprocessing.sh
15:
16: 3. Run 'systemctl restart cups'
17:
18
19LOGFILE=/tmp/$0.$$.log
20LOGFILE=
21
22if [ "$LOGFILE" ]
23then
24 exec >>"$LOGFILE" 2>&1
25fi
26
27set -ex
28
29: progname "$0" args "$*"
30
31[ "$2" = nobody ] || exit 0
32
33default_printer=$(env - lpstat -d)
34default_printer=${default_printer##* }
35
36[ "$default_printer" ]
37[ "$PRINTER_INFO" ]
38[ "$PRINTER_INFO" != "$default_printer" ]
39
40env - lp -d "$default_printer" "$1"