Posted on 03-30-2017 12:19 PM
Any ideas on how to script this:
Seems straight forward but it looks like switching users maybe required (which I am not sure is allowed in bash), as well as using 'dsenableroot', which requires including a root password. But then doing dsenableroot -d to disable at the end.... thx, john
Posted on 03-30-2017 12:36 PM
Sorry, but straightforward though it may be, could you clarify what you want to do a bit? I take that it is something beyond simply turning the local CUPS web interface on?
Posted on 03-30-2017 12:53 PM
Sure, just want to do:
sudo cupsctl WebInterface=Yes
Which turns on the CUPS web portal, but also allows access to the Admin area, Add / Delete printers, etc.
But, this apparently uses 'dsenableroot', as well as local admin prompts and passwords to be input.
Posted on 03-30-2017 01:37 PM
If you're running it as part of a casper policy under Files and Processes or Scripts, it is run as root by default and you can simply omit the sudo call.
If you just want to give non-admin users the ability to add and remove printers, you can modify membership in the lpadmin group and not bother with the local CUPS web interface.
Posted on 03-31-2017 07:10 AM
@joshuasee is correct, you can easily run this in the Execute Command field of a policy. It works great!