[K12OSN] Printing to spesfic printers only

James P. Kinney III jkinney at localnetsolutions.com
Wed Oct 4 14:25:27 UTC 2006


On Wed, 2006-10-04 at 06:59 -0600, jconlon1 at 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 at 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 at localnetsolutions.com>
Fingerprint = 3C9E 6366 54FC A3FE BA4D 0659 6190 ADC3 829C 6CA7
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://listman.redhat.com/archives/k12osn/attachments/20061004/f71aebf2/attachment.sig>


More information about the K12OSN mailing list