> From [EMAIL PROTECTED] Mon Feb 26 12:09:53 2001
> Date: Mon, 26 Feb 2001 14:12:03 -0500 (EST)
> From: Mike Hurst  <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: LPRng: How can I change the job "Class" setting.
>
> I have a series of print queues in my printcap file for each of my
> ethernet printers.
>
> I also have some printers that are not ethernet ready. I have a single
> print queue for all the non-ethernet printers. Any jobs sent to this print
> queue are redirected based on the "Class" setting in the control file.
>
> Here is a better description of that queue...
> - It's an LPRng print queue with printing disabled.
> - A program regularly check for any pending jobs and moves the job to a
> new directory based on the jobs Class entry in the control file.
> - This other directory is mounted by a PC connected to the printer.
>
> Here is my problem...
> Sometimes I cannot set the Class setting when printing a job and therefore
> I cannot send jobs to any non-ethernet printers. When I send jobs from a
> Windows 2000 computer using the LPR port I can only specify the server and
> printer names.
> I would like to set up a specific queue for each non-ethernet printer that
> adds the Class setting into the jobs control file and then forwards the
> job to the generic non-ethernet queue for further processing.
>
> It may sound like I could just set each custom queue to spool to the
> proper PC mounted directory, however it's not that simple. I need to find
> a way to set/change the Class setting.
>
> I have been able to change the Class that is sent to the filter however
> the Class entry in the control file does not change.
>
> Am I forced to write a filter that rewrites the control files for every
> job or is there something more simple?  A ":class=blahblah" printcap entry
> would be nice.
>
> Any help/suggestions would be great.
>
> Mike Hurst.
>
> ---------------------------------------------------------------------------
> Mike Hurst                                       Systems Support Specialist
> [EMAIL PROTECTED]                          Engineering Computing
> (519) 888-4567 ext.6146                              University of Waterloo

Ummm... it looks like you have to add a filter to do this:

lp:class=newclass:filter_incoming_job=/usr/local/libexec/filters/add_class

/usr/local/libexec/filters/add_class

#!/bin/sh
echo $PRINTCAP_ENTRY | /bin/sed -n s/.*class=/C/p
exit 0

Note that if there already is a class then this will not
change it.  If you want this operation, use:
#!/bin/sh
echo $PRINTCAP_ENTRY | /bin/sed -n s/.*class=/C/p
/bin/sed /^C/d
exit 0


Patrick Powell                 Astart Technologies,
[EMAIL PROTECTED]            9475 Chesapeake Drive, Suite D,
Network and System             San Diego, CA 92123
  Consulting                   858-874-6543 FAX 858-279-8424 
LPRng - Print Spooler (http://www.lprng.com)

-----------------------------------------------------------------------------
YOU MUST BE A LIST MEMBER IN ORDER TO POST TO THE LPRNG MAILING LIST
The address you post from MUST be your subscription address

If you need help, send email to [EMAIL PROTECTED] (or lprng-requests
or lprng-digest-requests) with the word 'help' in the body.  For the impatient,
to subscribe to a list with name LIST,  send mail to [EMAIL PROTECTED]
with:                           | example:
subscribe LIST <mailaddr>       |  subscribe lprng-digest [EMAIL PROTECTED]
unsubscribe LIST <mailaddr>     |  unsubscribe lprng [EMAIL PROTECTED]

If you have major problems,  send email to [EMAIL PROTECTED] with the word
LPRNGLIST in the SUBJECT line.
-----------------------------------------------------------------------------

Reply via email to