[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [K12OSN] Printing question



Randall Swift wrote:

k12osn redhat com writes:


Just crank up cups....point your browser to
http://localhost:631........setup the printer and you're done. When the
clients click print they will automagically print to the server's default
printer. This is how we have done it here.
--


The problem I see with this is that both labs will print to the same
printer. I want each lab to print to the printer in that specific lab. Lab
1 will print to printer 1 in that lab and lab2 will print to a different
printer (printer 2) in  lab2. Does this sound plausible? Thanks

Randy Swift
Network Administrator
Leavitt Area High School
Turner, Maine 04282
(207)225-3533
swift msad52 k12 me us


_______________________________________________ K12OSN mailing list K12OSN redhat com https://www.redhat.com/mailman/listinfo/k12osn For more info see <http://www.k12os.org>




I don't have a k12ltsp system here yet to test this on, but unless I'm overlooking something there is a straightforward solution. Setting the PRINTER environment variable overrides what the default printer is. So if you can determine when a person logs in which printer you want them to have then you can solve your problem.

I think a small script under /etc/profile.d/, perhaps named /etc/profile.d/assignDefaultPrinter.sh would be a readily maintainable and deployable solution. In that you could detect which workstation the person has logged in from (assuming you aren't subject to the kde "who" issue mentioned recently) and assign the correct default printer.

If the workstation hostnames include the lab name in them then you can do something like:
who -m|grep -q lab1 && export PRINTER="lab1printer"
who -m|grep -q lab2 && export PRINTER="lab2printer"


But if they don't include the lab name then you can still determine the workstation name, then apply a case statement to determine which printer to use:
workstation=`who -m|cut -d\( -f2|cut -d\) -f1`
case $workstation in
ws001.mydomain)
export PRINTER="lab1printer";;
ws002.mydomain)
export PRINTER="lab1printer";;
ws025.mydomain)
export PRINTER="lab2printer";;
ws026.mydomain)
export PRINTER="lab2printer";;
esac


I think you get the idea.
Don't forget to set the mode of the .sh file to 755.

--
Chris Johnson, RHCE #807000448202021





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]