Home › Forums › OS X Server and Client Discussion › Questions and Answers › Help scripting printer options using lpoptions
- This topic has 1 reply, 1 voice, and was last updated 16 years, 4 months ago by
jasonkstupski.
-
AuthorPosts
-
July 7, 2010 at 11:29 pm #379036
jasonkstupski
ParticipantHello there,
I’m trying to script the addition of some printers that will be run as a postflight script on an InstaDMG image. Right now I’m trying to just figure out setting the options. I think I’m doing it correctly, but for some reason the options in System Preferences don’t seem to be sticking. Here’s what I’m trying to do.
I have a printer called Kermit. I type:
lpoptions -p Kermit -lAnd here’s the first few lines of what I get (the option I want to change is in the first lines).
HPOption_Tray3/Tray 3: *False Tray3_500 HPOption_Tray4/Tray 4: *False Tray4_500 HPOption_Tray5/Tray 5: *False Tray5_500 HPOption_Disk/Printer Disk: *True False HPOption_Duplexer/Duplex Unit: *True FalseI want to set the option for Tray 3 to have a tray of 500 sheets. So I type the following:
lpoptions -p Kermit -o HPOption_Tray3=Tray3_500Then, when I ask for the settings again using that first line, I get this:
HPOption_Tray3/Tray 3: False *Tray3_500 HPOption_Tray4/Tray 4: *False Tray4_500 HPOption_Tray5/Tray 5: *False Tray5_500 HPOption_Disk/Printer Disk: *True False HPOption_Duplexer/Duplex Unit: *True FalseThe asterisk has moved to “Tray3_500”, suggesting to me that the setting has changed.
However, when I go into the Options tab under that print queue in systems preferences, it still says “Not Installed.” If I set it from the GUI in System Preferences, it does what I would expect it to on the back end – it moves the asterisk from False to Tray3_500.
What am I missing here? Any help would be most appreciated.
Thanks,
JasonJuly 14, 2010 at 11:11 pm #379095jasonkstupski
ParticipantSolved this by not using the lpoptions command and rolling it in at the same time as using the lpadmin command.
Ended up like this:
#/usr/sbin/lpadmin -p "Printer Name" -E -v lpd://"xxx.xx.xx.xx"/ -P "ppdlocation.gz" -D "Printer Name" -o printer-is-shared=false -o HPOption_Tray3=Tray3_500 -L "Location"Works for me. Couldn’t figure out why using the lpoptions command after the fact didn’t work, but oh well.
Thanks,
Jason -
AuthorPosts
- You must be logged in to reply to this topic.