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

Re: [K12OSN] Printing to spesfic printers only



On Wed, 2006-10-04 at 06:59 -0600, jconlon1 elp rr com wrote:
> We have a large server that runs a lab and several 4-6 terminal groups
> in some classrooms.  Some classrooms have one terminal being used as a
> Jet Direct device.  Is ther a way to set things up so that a classroom
> group will default to the jet directed printer only?  If there is How do
> I do it?

Here is what I am gearing up to do along this same line:

Scenario:
Up to 200 thin clients attached to a single server. Each classroom has a
networked printer that cups on the server knows about. Students have
NIS/NFS roving profiles since they move around the school (middle
school).
During the login process, a script is run that determines the host name
(all fixed-IP host name in dhcp.conf) that the student is accessing the
server from.
Host names are based on room number and station number: rmXXXwsYY where
XXX is the room number and YY is the station number in the room.
Printers are named similarly: rmXXXlaser

At the moment, I am determining the best place to put the script
(~/.xinitrc , ~/.bashrc , ~/.xsession , ... ) .

Here is the script:

#!/bin/sh

# This script will identify the host name from which a login occurs
# It will then use that name to set the default printer
# This requires hostname formatted as rmXXXwsYY and pinters as
rmXXXlaser
# XXX is the room number and YY is the station number in the room.
# the script runs as the user logging in and sets options in
~/.lpoptions

export PATH="/bin:/usr/bin"

lpoptions -d `netstat -t -e | grep ESTABLISHED | grep $USER | sed
's/:/ /g'| awk '{print $6}' | sort | uniq | cut -f 1 -d "." | sed 's/ws
\w*/laser/'`

# Place this script in /usr/local/bin/defaultprinter.sh on the server
with 755 permisions


NOTE: the lpoptions line is one line. email will wrap it.

Part 2: Blocking printing to a printer not in the same room with the
student:

In cups, each printer should allow printing only from a given range of
IP address. That is done with per printer settings in cupsd.conf.
HOWEVER, I don't have this part working yet as the print job originates
on the server and not the client. I am looking pykota/tea4cups as a
possible way to rewrite the source address on the print job.
> 
> Thanks in advance
> Pat
> 
> _______________________________________________
> K12OSN mailing list
> K12OSN redhat com
> https://www.redhat.com/mailman/listinfo/k12osn
> For more info see <http://www.k12os.org>
-- 
James P. Kinney III          
CEO & Director of Engineering 
Local Net Solutions,LLC        
770-493-8244                    
http://www.localnetsolutions.com

GPG ID: 829C6CA7 James P. Kinney III (M.S. Physics)
<jkinney localnetsolutions com>
Fingerprint = 3C9E 6366 54FC A3FE BA4D 0659 6190 ADC3 829C 6CA7

Attachment: signature.asc
Description: This is a digitally signed message part


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