Re: [netatalk-admins] hiding laserwriters


Subject: Re: [netatalk-admins] hiding laserwriters
From: wesley.craig@umich.edu
Date: Wed Feb 25 1998 - 10:56:40 EST


> From: "Gerry.Tomlinson" <Gerry.Tomlinson@newcastle.ac.uk>
> To: rich@pubserv.com (Richard Mann)

> 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.

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 ---



This archive was generated by hypermail 2b28 : Sat Dec 18 1999 - 16:31:12 EST