{"id":2144,"date":"2015-04-20T14:14:30","date_gmt":"2015-04-20T14:14:30","guid":{"rendered":"http:\/\/blog.designed79.co.uk\/?p=2144"},"modified":"2015-04-20T14:14:30","modified_gmt":"2015-04-20T14:14:30","slug":"reset-mac-os-x-printer-system-from-command-line","status":"publish","type":"post","link":"https:\/\/blog.designed79.co.uk\/?p=2144","title":{"rendered":"Reset Mac OS X Printer System from command line"},"content":{"rendered":"<div class=\"codecolorer-container text default\" style=\"overflow:auto;white-space:nowrap;height:300px;\"><div class=\"text codecolorer\">#!\/bin\/bash<br \/>\n<br \/>\n#resetprinting<br \/>\n#This resets the printer system in the same manor as the GUI reset printers works<br \/>\n#v1.0 Daniel Shane 27\/06\/14<br \/>\n<br \/>\n#Check we are root<br \/>\nif [ $EUID != 0 ]<br \/>\nthen<br \/>\n&nbsp; &nbsp; echo &quot;`basename $0` MUST run as root...&quot;<br \/>\n&nbsp; &nbsp; exit 1<br \/>\nfi<br \/>\n<br \/>\n#Remove all Printers from CUPS<br \/>\nfor file in \/etc\/cups\/ppd\/* ; do<br \/>\n&nbsp; &nbsp; path=${file%.ppd}<br \/>\n&nbsp; &nbsp; name=${path##*\/}<br \/>\n&nbsp; &nbsp; lpadmin -x $name &amp;&gt; \/dev\/null<br \/>\ndone<br \/>\n<br \/>\n#Loop RM of All Users printers .apps<br \/>\nls -1 &quot;$3&quot;\/Users\/ | while read useris<br \/>\n&nbsp; &nbsp; do<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; rm -rf &quot;$3&quot;\/Users\/&quot;$useris&quot;\/Library\/Printers\/* &amp;&gt; \/dev\/null<br \/>\n&nbsp; &nbsp; done<br \/>\n<br \/>\n#Reset CUPS<br \/>\nlaunchctl stop org.cups.cupsd<br \/>\nrm \/etc\/cups\/cupsd.conf &amp;&gt; \/dev\/null<br \/>\ncp \/etc\/cups\/cupsd.conf.default \/etc\/cups\/cupsd.conf &amp;&gt; \/dev\/null<br \/>\nrm \/etc\/cups\/printers.conf &amp;&gt; \/dev\/null<br \/>\nrm \/Library\/Printers\/InstalledPrinters.plist &amp;&gt; \/dev\/null<br \/>\nlaunchctl start org.cups.cupsd<br \/>\n<br \/>\nexit 0<\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>#!\/bin\/bash #resetprinting #This resets the printer system in the same manor as the GUI reset printers works #v1.0 Daniel Shane 27\/06\/14 #Check [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2144","post","type-post","status-publish","format-standard","hentry","category-info-on-tech"],"_links":{"self":[{"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/2144","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2144"}],"version-history":[{"count":0,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/2144\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2144"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2144"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.designed79.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2144"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}