You could use the "lpadmin" command in the script instead of writing
into printers.conf directly:

######################################################
        echo "====Enter the name of the printer to be installed:==== "
        read printerName
        sudo lpadmin -p "$printerName" -E -v "lpd://10.0.0.3/$printerName" -D 
"$printerName" -o printer-error-policy=stop-printer
        echo "============================================="
        sudo cp /mnt/printer /usr/local/bin/.
        sudo cp /mnt/changes /usr/local/bin/.
        sudo chmod -R 700 /usr/local/bin/
        echo "============================================="
        echo "#!/bin/sh -e" | sudo tee -a /etc/rc.local
        echo "/usr/local/bin/printer" | sudo tee -a /etc/rc.local
        echo "/usr/local/bin/changes" | sudo tee -a /etc/rc.local
        echo "exit 0" | sudo tee -a /etc/rc.local
        echo "============================================="

###################################################################

See "man lpadmin" for more possibilities.

I will close the bug as we will not change the architecture of CUPS to
be different to upstream in Ubuntu.


** Changed in: cups (Ubuntu)
       Status: New => Won't Fix

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/627287

Title:
  Rewrites /etc/cups/printers.conf every night

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to