#!/bin/sh : This script allows a shared network PDF printer to be : used to send documents to the default printer. : That way, clients do not need to install the : printer-specific driver that would be needed if the : default printer were shared directly. Only the standard : cups PDF printer driver is needed. : To use: : : 1. Copy this file to '/etc/cups/cups-pdf.postprocessing.sh' : : 2. Add the following line to '/etc/cups/cups-pdf.conf' : \ PostProcessing /etc/cups/cups-pdf.postprocessing.sh : : 3. Run 'systemctl restart cups' : LOGFILE=/tmp/$0.$$.log LOGFILE= if [ "$LOGFILE" ] then exec >>"$LOGFILE" 2>&1 fi set -ex : progname "$0" args "$*" [ "$2" = nobody ] || exit 0 default_printer=$(env - lpstat -d) default_printer=${default_printer##* } [ "$default_printer" ] [ "$PRINTER_INFO" ] [ "$PRINTER_INFO" != "$default_printer" ] env - lp -d "$default_printer" "$1"