#!/bin/sh BINDIR=`dirname $0`/../../bin SBINDIR=`dirname $0`/../../sbin PATH=${BINDIR}:${SBINDIR}:$PATH # checks to see if a given printername is already in use printername=$1 echo "looking for the printer" lpstat -c $printername if [ $? -eq 0 ] then echo "returning 1 -- class exists" exit 1 else lpstat -p $printername if [ $? -eq 0 ] then echo "returning 0 -- printer exists" exit 0 else echo "returning 2 -- does not exist" exit 2 fi fi