Skip to main content

Hi guys



i tried sudo lpadmin -E -p printer_name



but this disnt resume the printer. Has anyone else seen this in mountain lion?

it was cupsenable printer_name


#!/bin/bash


printer=`lpstat -p | grep "disabled" | awk '{print $2}'`

cupsenable $printer

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.


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.