Posted on 03-06-2013 09:16 AM
Hi guys
i tried sudo lpadmin -E -p printer_name
but this disnt resume the printer. Has anyone else seen this in mountain lion?
Solved! Go to Solution.
Posted on 03-06-2013 09:22 AM
#!/bin/bash
printer=`lpstat -p | grep "disabled" | awk '{print $2}'`
cupsenable $printer
Posted on 03-06-2013 09:20 AM
it was cupsenable printer_name
Posted on 03-06-2013 09:22 AM
#!/bin/bash
printer=`lpstat -p | grep "disabled" | awk '{print $2}'`
cupsenable $printer
Posted on 10-01-2014 04:52 PM
I put this one-liner into a script and included it in our imaging - works like a charm!
lpstat -p | grep "disabled" | awk '{print $2}' | xargs -n 1 -I{} sudo cupsenable {}
Thanks @tkimpton for the idea.
Posted on 12-06-2018 12:59 PM
I made two changes to the final script that was posted
lpstat -p | grep -B 1 "Paused" | awk '{print $2}' | xargs -n 1 -I{} sudo cupsenable {}
The reason is that printers that ave been deleted can sometimes show in lpstat as being disabled. While I did not necessarily think that that would cause the script to fail, I only want to resume print queues that have been paused.
In my OSX 10.13 the 'Paused' notification was displaying on the line below (as such)
printer Buchan_2B disabled since Thu Dec 6 12:58:23 2018 - Paused
so I added the -B 1 modifier.