Fix for LPR and Canon new printers

carmelolopez
Contributor

Hi,

at my working place we use Canon printers (Fiery Rip).
I found out if you deploy it using LPR, it will change the LPR://nameofserver/queue with CNIO2://..

So Basically I did a small script to fix this.
Will modify the /etc/cups/printers.conf

Here is the script
**
#!/bin/bash

# configuration
PRINTERSCONF=/etc/cups/printers.conf
PERL=/usr/bin/perl
DATE=date +"%d-%b-%Y"
SCRIPT='/DeviceURI cnips2/ && {s/DeviceURI cnips2/DeviceURI lpd/}'

# do replacements

su perl -i.backup -p -e '/DeviceURI cnips2/ && {s/DeviceURI cnips2/DeviceURI lpd/}' /etc/cups/printers.conf

# restart CUPSsu launchctl stop org.cups.cupsd ; launchctl start org.cups.cupsd
**

Hope it helps someone out there.

Cheers
Carmel

2 REPLIES 2

CypherCookie
Contributor

Thank you so much! this worked a treat!

msemertzides
New Contributor II

<DELETED>