Subject: [netatalk-admins] hiding laserwriters

From: Richard Mann <[email-masked]>
Date: Tue, 24 Feb 1998 13:39:50 -0600 (CST)

Is there a good way to hide a laserwriter from the
Chooser? This would be in the interest of having
all print jobs go to the unix-spooled device (which
*would* still show up in the Chooser), instead
of haphazardly from various locations.

One way would probably be to change the printer type
from laserwriter to something else. Has anyone 
done this with good results?

The bad thing would be various Mac utilities not
being able to see the printer anymore, such as
Font Downloader or LaserWriter Utility, but it
might still be worth the hassle.

     //\     --rich
    //  \    
   // /  \   Richard Mann -- Network Administrator
  // / /  \  P u b l i c a t i o n  S e r v i c e s,  I n c. 
  \\  / / /  Champaign, Illinois, USA 61821 (217) 398-2060 x22
   \\  / /   
    \\  /    
     \\/

---

From: Michael M Han <[email-masked]>
Date: Tue, 24 Feb 1998 13:29:38 -0800

I take it to mean that you want to hide the device which advertises
itself on AppleTalk, but leave the spooler advertised by papd? We used
a little shareware utility called LaserWriter Lockout. It was buggy
and a nuisance, but did essentially do what it's supposed to. If you
don't want people in the Chooser at all, you could always set the
Chooser Invisible; the System would still see it, but no one could run
it. Or you could do strange things with ResEdit, which I wouldn't
recommend. Any of these would be preferable to trying to hide the
device itself, as I really can't think of any way to accomplish that
without hiding the printer from papd, too...

Previously...
>might still be worth the hassle.
_________
mike ([email-masked])
I will not cut corners
"  "    "   "     "
 - The collected wisdom of Bart Simpson

---

From: "Gerry.Tomlinson" <[email-masked]>
Date: Wed, 25 Feb 1998 10:59:00 +0000 (GMT)

> done this with good results?

I use the following rc script to change the printer(s) type -
I run it from cron since most printers revert to LaserWriter
when powering on.

#!/usr/local/bin/rc
#
# hidelw [-a] printer ...
#
# change the nbp type of a laserprinter  to that
# specified in its .paprc file  causing it to be hidden from the chooser 
# if the type is not LaserWriter.
# gets the nbp name from the spool dir .paprc file too
#
#  printer is a spool queue name
#
# -a option  looks for all printers with a .paprc file

path = (/usr/local/atalk/current/bin /usr/local/sbin /usr/local/bin $path)
if (~ $#* 0) {
        echo usage: `{basename $0} [-a] printer .... >[1=2]
        exit 1
}

if (~ $1 -a) {
        for (i in /var/spool/lpd/*/.paprc) printers = ( $printers  `{basename `{dirname $i}} )
} else printers = $*

for (i in $printers) {
    if ( [ -d /var/spool/lpd/^$i ] ) {
        name = `{sed 's/:.*//' <  /var/spool/lpd/^$i^/.paprc}
        type = `{sed  's/.*://' < /var/spool/lpd/^$i^/.paprc}
        papstatus -p $^name >/dev/null  >[2=1] &&
        pap -p $^name << END
        (%EtherTalk_NV%) << /EtherTalkType ($type) >> setdevparams
END
    } else  echo >[1=2] $i: no such printer
}

> might still be worth the hassle.

you can resedit the mac utilities to use the new type name for
occasions when you really do want to get directly at the printer.

	Gerry.

---
[email-masked]
Computing Officer
Department of Computing Science, University of Newcastle, Tel: +44 191 222 8139
Newcastle upon Tyne, NE1 7RU, United Kingdom.             Fax: +44 191 222 8232

---

From: [email-masked]
Date: Wed, 25 Feb 1998 10:56:40 -0500

> From:    "Gerry.Tomlinson" <[email-masked]>
> To:      [email-masked] (Richard Mann)

> I run it from cron since most printers revert to LaserWriter

That's pretty cool, Gerry.  I don't use rc around here, so here's the
script we use.  Your's is better since mine relies on there not being
certain .paprc cases that we never use.  I guess it could be fixed by
setting IFS twice.  By running "hideprinters.sh" out of cron, it sends
mail when the type needs to be changed.  We run is once every 15
minutes for machines that service around 6 printers.

:wes

--- cut ---
#!/bin/sh
# wes and spanky 1/28/97

PATH=/usr/bin:/usr/local/etc
ZONE="*"

cd /var/spool/lpd
for i in *; do 
	if [ ! -f "$i"/.paprc ]; then
		continue
	fi

	TIFS="$IFS"
	IFS=":@"
	set `cat "$i"/.paprc`
	IFS="$TIFS"

	if [ $# -eq 1 ]; then
		continue
	fi

	if [ $# -eq 3 ]; then
		ZONE="$3"
	fi

	if [ $# -gt 3 ]; then
		echo OOPS!
	fi

	setprintertype.sh -p "$1@$ZONE" "$2" > /dev/null 2>&1
	if [ $? -eq 0 ]; then
		echo "$1@$ZONE changed to $2"
	fi
done
--- cut ---