10Sstevel@tonic-gate#!/bin/sh
20Sstevel@tonic-gate#
30Sstevel@tonic-gate# CDDL HEADER START
40Sstevel@tonic-gate#
50Sstevel@tonic-gate# The contents of this file are subject to the terms of the
60Sstevel@tonic-gate# Common Development and Distribution License, Version 1.0 only
70Sstevel@tonic-gate# (the "License").  You may not use this file except in compliance
80Sstevel@tonic-gate# with the License.
90Sstevel@tonic-gate#
100Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
110Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
120Sstevel@tonic-gate# See the License for the specific language governing permissions
130Sstevel@tonic-gate# and limitations under the License.
140Sstevel@tonic-gate#
150Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
160Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
170Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
180Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
190Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
200Sstevel@tonic-gate#
210Sstevel@tonic-gate# CDDL HEADER END
220Sstevel@tonic-gate#
230Sstevel@tonic-gate#
24*831Swendyp# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
250Sstevel@tonic-gate# Use is subject to license terms.
260Sstevel@tonic-gate#
270Sstevel@tonic-gate# ident	"%Z%%M%	%I%	%E% SMI"
280Sstevel@tonic-gate#
290Sstevel@tonic-gatePATH=/bin:/usr/bin:/usr/sbin export PATH
300Sstevel@tonic-gate
310Sstevel@tonic-gateTEXTDOMAIN="SUNW_OST_OSCMD"
320Sstevel@tonic-gateexport TEXTDOMAIN
330Sstevel@tonic-gate
340Sstevel@tonic-gateLPSET=/usr/bin/lpset
350Sstevel@tonic-gateLPGET=/usr/bin/lpget
360Sstevel@tonic-gate
370Sstevel@tonic-gateHOST=`/bin/uname -n`
38*831SwendypLHOST="localhost"
390Sstevel@tonic-gatePID=$$
400Sstevel@tonic-gate
410Sstevel@tonic-gatecmd_name=lpadmin
420Sstevel@tonic-gateexit_code=0
430Sstevel@tonic-gate
440Sstevel@tonic-gateusage() {
450Sstevel@tonic-gate	gettext "Usage:\n" 1>&2
460Sstevel@tonic-gate	gettext "	lpadmin -p (printer) (options)\n" 1>&2
470Sstevel@tonic-gate	gettext "	lpadmin -x (dest)\n" 1>&2
480Sstevel@tonic-gate	gettext "	lpadmin -d (dest)\n" 1>&2
490Sstevel@tonic-gate	gettext "	lpadmin -S print-wheel -A alert-type [ -W minutes ]\n" 1>&2
500Sstevel@tonic-gate	gettext "		[ -Q requests ]\n" 1>&2
510Sstevel@tonic-gate	gettext "	lpadmin -M -f form-name [ -a [ -o filebreak ]\n" 1>&2
520Sstevel@tonic-gate	gettext "		[ -t tray-number ]]\n" 1>&2
530Sstevel@tonic-gate	exit 1
540Sstevel@tonic-gate}
550Sstevel@tonic-gate
560Sstevel@tonic-gate#
570Sstevel@tonic-gate# Delete entries in /etc/printers.conf for local printers/classes that no longer
580Sstevel@tonic-gate# exist in the /etc/lp database
590Sstevel@tonic-gate#
600Sstevel@tonic-gate
610Sstevel@tonic-gatedelete_local() {
620Sstevel@tonic-gate
630Sstevel@tonic-gate# Get printer names for each local printer
640Sstevel@tonic-gate# grep /etc/printers.conf for each bsdaddr for this server
650Sstevel@tonic-gate# get printer name from that line
660Sstevel@tonic-gate
67*831Swendypfor LINE in `/bin/grep bsdaddr /etc/printers.conf |
68*831Swendyp	/bin/egrep -e ${HOST}\|${LHOST}`
690Sstevel@tonic-gatedo
70*831Swendyp        PRINTER=`echo ${LINE} | /bin/sed -e 's/^:bsdaddr='$LHOST',//' \
71*831Swendyp		-e 's/^:bsdaddr='$HOST',//' \
72*831Swendyp		-e 's/[,:].*//'`
730Sstevel@tonic-gate
740Sstevel@tonic-gate# If there is not an entry for this printer in
750Sstevel@tonic-gate#       /etc/lp/printers or /etc/lp/classes
760Sstevel@tonic-gate# Then delete the entry for this printer in /etc/printers.conf
770Sstevel@tonic-gate
780Sstevel@tonic-gate        if [ ! -d /etc/lp/printers/${PRINTER} -a ! -f /etc/lp/classes/${PRINTER} ] ;
790Sstevel@tonic-gate        then
800Sstevel@tonic-gate                logger -p lpr.debug -t "lpadmin[${PID}]" \
810Sstevel@tonic-gate                         "Removing $PRINTER entry from /etc/printers.conf"
820Sstevel@tonic-gate                ${LPSET} -x ${PRINTER}
830Sstevel@tonic-gate                status=$?
840Sstevel@tonic-gate
850Sstevel@tonic-gate                if [ ${status} -ne 0 ] ; then
860Sstevel@tonic-gate                        gettext "Warning: error removing ${PRINTER} " 1>&2
870Sstevel@tonic-gate			gettext "entry from /etc/printers.conf\n" 1>&2
880Sstevel@tonic-gate                        logger -p lpr.debug -t "lpadmin[${PID}]" \
890Sstevel@tonic-gate				"Call to lpset -x $PRINTER exits with ${status}"
900Sstevel@tonic-gate			exit_code=1
910Sstevel@tonic-gate                fi
920Sstevel@tonic-gate        fi
930Sstevel@tonic-gatedone
940Sstevel@tonic-gate
950Sstevel@tonic-gate#
960Sstevel@tonic-gate# shutdown scheduler if there are no local printers
970Sstevel@tonic-gate#
980Sstevel@tonic-gateCONFIGS=/etc/lp/printers/*/configuration
990Sstevel@tonic-gate
1000Sstevel@tonic-gateprinters_configured=`echo $CONFIGS`
1010Sstevel@tonic-gateif [ "$printers_configured" = "$CONFIGS" ]; then
1020Sstevel@tonic-gate	svcprop -q svc:/application/print/server:default &&
1030Sstevel@tonic-gate		svcadm disable svc:/application/print/server:default
1040Sstevel@tonic-gatefi
1050Sstevel@tonic-gate}
1060Sstevel@tonic-gate
1070Sstevel@tonic-gatedelete_entries() {
1080Sstevel@tonic-gateif [ ! -f /etc/printers.conf ] ; then
1090Sstevel@tonic-gate        logger -p lpr.debug -t "lpadmin[${PID}]" \
1100Sstevel@tonic-gate		"System error: Cannot access /etc/printers.conf"
1110Sstevel@tonic-gate        gettext "lpadmin: System error; Cannot access /etc/printers.conf\n" 1>&2
1120Sstevel@tonic-gate        exit 1
1130Sstevel@tonic-gatefi
1140Sstevel@tonic-gate
1150Sstevel@tonic-gate# remove _default
1160Sstevel@tonic-gate
117*831SwendypDEFAULTP=`${LPGET} _default | /bin/grep use | /bin/sed -e 's/[    ]*use=//'`
1180Sstevel@tonic-gate${LPGET} -k bsdaddr ${DEFAULTP} >/dev/null 2>&1
1190Sstevel@tonic-gatestatus=$?
1200Sstevel@tonic-gate
1210Sstevel@tonic-gateif [ ${status} -eq 0 ] ; then
1220Sstevel@tonic-gate	${LPSET} -x _default
1230Sstevel@tonic-gate	status=$?
1240Sstevel@tonic-gate	if [ ${status} -ne 0 ] ; then
1250Sstevel@tonic-gate		gettext "Warning: error removing _default entry from /etc/printers.conf\n" 1>&2
1260Sstevel@tonic-gate		logger -p lpr.debug -t "lpadmin[${PID}]" \
1270Sstevel@tonic-gate			"Call to lpset -x _default exits with ${status}"
1280Sstevel@tonic-gate		exit_code=1
1290Sstevel@tonic-gate	fi
1300Sstevel@tonic-gatefi
1310Sstevel@tonic-gate
1320Sstevel@tonic-gate# delete entries in /etc/printers.conf for printers/classes that have
1330Sstevel@tonic-gate# been deleted
1340Sstevel@tonic-gate
1350Sstevel@tonic-gatedelete_local
1360Sstevel@tonic-gate
1370Sstevel@tonic-gate# Delete all the remote printers using bsdaddr
1380Sstevel@tonic-gate
139*831Swendypfor LINE in `/bin/grep bsdaddr /etc/printers.conf | /bin/egrep -v -e ${HOST}\|${LHOST}`
1400Sstevel@tonic-gatedo
141*831Swendyp        PRINTER=`echo $LINE | /bin/sed -e 's/^:bsdaddr=[^,]*,//' -e 's/[,:].*//'`
1420Sstevel@tonic-gate        ${LPSET} -x $PRINTER
1430Sstevel@tonic-gate	status=$?
1440Sstevel@tonic-gate
1450Sstevel@tonic-gate	if [ ${status} -ne 0 ] ; then
1460Sstevel@tonic-gate		gettext "Warning: error removing ${PRINTER} entry from /etc/printers.conf\n" 1>&2
1470Sstevel@tonic-gate		logger -p lpr.debug -t "lpadmin[${PID}]" \
1480Sstevel@tonic-gate			"Call to lpset -x $PRINTER exits with ${status}"
1490Sstevel@tonic-gate		exit_code=1
1500Sstevel@tonic-gate	fi
1510Sstevel@tonic-gatedone
1520Sstevel@tonic-gate}
1530Sstevel@tonic-gate
1540Sstevel@tonic-gateif [ $# -lt 1 ] ; then
1550Sstevel@tonic-gate	usage
1560Sstevel@tonic-gate	exit 1
1570Sstevel@tonic-gatefi
1580Sstevel@tonic-gate
1590Sstevel@tonic-gate# Deal with the -d option independently since getopts does not handle
1600Sstevel@tonic-gate# options that may or may not have arguments
1610Sstevel@tonic-gate#
1620Sstevel@tonic-gatefirst=$1
1630Sstevel@tonic-gatesecond=$2
1640Sstevel@tonic-gatethird=$3
1650Sstevel@tonic-gate
1660Sstevel@tonic-gateif [ ${first} = "-d" ] ; then
1670Sstevel@tonic-gate	# check that there are no extra arguments
1680Sstevel@tonic-gate	if [ -n "${third}" ] ; then
1690Sstevel@tonic-gate		usage
1700Sstevel@tonic-gate		exit 1
1710Sstevel@tonic-gate	fi
1720Sstevel@tonic-gate
1730Sstevel@tonic-gate
1740Sstevel@tonic-gate	# be sure we have lpset and lpget
1750Sstevel@tonic-gate	if [ ! -f ${LPSET} -o ! -f ${LPGET} ] ; then
1760Sstevel@tonic-gate		gettext "lpadmin: System error; cannot set default printer\n" 1>&2
1770Sstevel@tonic-gate		exit 2
1780Sstevel@tonic-gate	fi
1790Sstevel@tonic-gate
1800Sstevel@tonic-gate	if [ ! -n "${second}" ] ; then
1810Sstevel@tonic-gate		${LPGET} -n system _default >/dev/null 2>&1
1820Sstevel@tonic-gate		exit_code=$?
1830Sstevel@tonic-gate		if [ ${exit_code} -eq 0 ] ; then
1840Sstevel@tonic-gate			# delete _default entry in /etc/printers.conf
1850Sstevel@tonic-gate			${LPSET} -n system -x _default
1860Sstevel@tonic-gate			exit_code=$?
1870Sstevel@tonic-gate			if [ ${exit_code} -ne 0 ] ; then
1880Sstevel@tonic-gate				gettext "lpadmin: System error while trying to delete default printer\n" 1>&2
1890Sstevel@tonic-gate			fi
1900Sstevel@tonic-gate		else
1910Sstevel@tonic-gate			# there was no _default, the work is done
1920Sstevel@tonic-gate			exit_code=0
1930Sstevel@tonic-gate		fi
1940Sstevel@tonic-gate	else
1950Sstevel@tonic-gate		# add/change  _default entry in /etc/printers.conf
1960Sstevel@tonic-gate		${LPGET} -k bsdaddr ${second} >/dev/null 2>&1
1970Sstevel@tonic-gate		exit_code=$?
1980Sstevel@tonic-gate		if [ $exit_code -eq 0 ] ; then
1990Sstevel@tonic-gate			${LPSET} -n system -a use=${second} _default
2000Sstevel@tonic-gate			exit_code=$?
2010Sstevel@tonic-gate		else
2020Sstevel@tonic-gate			echo "${second}: " 1>&2
2030Sstevel@tonic-gate			gettext "undefined printer\n" 1>&2
2040Sstevel@tonic-gate		fi
2050Sstevel@tonic-gate
2060Sstevel@tonic-gate	fi
2070Sstevel@tonic-gate	exit ${exit_code}
2080Sstevel@tonic-gatefi
2090Sstevel@tonic-gate
2100Sstevel@tonic-gate#		Strip off legal options
2110Sstevel@tonic-gatewhile getopts "A:ac:D:e:f:F:H:hi:I:lm:Mn:o:p:Q:r:S:s:T:u:U:v:W:x:t:P:" arg
2120Sstevel@tonic-gatedo
2130Sstevel@tonic-gate	case $arg in
2140Sstevel@tonic-gate	D)
2150Sstevel@tonic-gate		description="${OPTARG}"
2160Sstevel@tonic-gate	;;
2170Sstevel@tonic-gate	p)
2180Sstevel@tonic-gate		if [ -n "${delete}" ] ; then
2190Sstevel@tonic-gate			usage
2200Sstevel@tonic-gate		fi
2210Sstevel@tonic-gate		printer=${OPTARG}
2220Sstevel@tonic-gate	;;
2230Sstevel@tonic-gate	s)
2240Sstevel@tonic-gate		server=${OPTARG}
2250Sstevel@tonic-gate	;;
2260Sstevel@tonic-gate	v|U)
2270Sstevel@tonic-gate		device=${OPTARG}
228*831Swendyp		if [ ! -n "${server}" ] ; then
229*831Swendyp			server=${HOST}
230*831Swendyp		fi
2310Sstevel@tonic-gate	;;
2320Sstevel@tonic-gate	x)
2330Sstevel@tonic-gate		if [ -n "${printer}" -o -n "${server}" -o \
2340Sstevel@tonic-gate		     -n "${device}" -o -n "${description}" ] ; then
2350Sstevel@tonic-gate			usage
2360Sstevel@tonic-gate		fi
2370Sstevel@tonic-gate		delete=${OPTARG}
2380Sstevel@tonic-gate		printer=${OPTARG}
2390Sstevel@tonic-gate		if [ ${printer} = "all" ] ; then
2400Sstevel@tonic-gate			local="true"
2410Sstevel@tonic-gate		fi
2420Sstevel@tonic-gate	;;
2430Sstevel@tonic-gate	S|M|A)
2440Sstevel@tonic-gate		local="true"
2450Sstevel@tonic-gate	;;
2460Sstevel@tonic-gate	c)
2470Sstevel@tonic-gate		class=${OPTARG}
2480Sstevel@tonic-gate		local="true"
2490Sstevel@tonic-gate		if [ ! -f ${LPGET} ] ; then
2500Sstevel@tonic-gate			gettext "lpadmin: System error; cannot set class\n " 1>&2
2510Sstevel@tonic-gate			exit 2
2520Sstevel@tonic-gate		fi
2530Sstevel@tonic-gate
2540Sstevel@tonic-gate		${LPGET} "${class}" > /dev/null 2>&1
2550Sstevel@tonic-gate		lpget_class=$?
2560Sstevel@tonic-gate		if [ ${lpget_class} -eq 0 -a ! -r /etc/lp/classes/"${class}" ] ; then
2570Sstevel@tonic-gate			gettext "lpadmin: ERROR: Can't create class ${class}.\n" 1>&2
2580Sstevel@tonic-gate			gettext "           TO FIX: This is an existing printer name;\n" 1>&2
2590Sstevel@tonic-gate			gettext "                   choose another name.\n" 1>&2
2600Sstevel@tonic-gate			exit 1
2610Sstevel@tonic-gate		fi
2620Sstevel@tonic-gate	;;
2630Sstevel@tonic-gate	r)
2640Sstevel@tonic-gate		pconflocalclean="true"
2650Sstevel@tonic-gate		local="true"
2660Sstevel@tonic-gate	;;
2670Sstevel@tonic-gate	esac
2680Sstevel@tonic-gatedone
2690Sstevel@tonic-gate
2700Sstevel@tonic-gate#
2710Sstevel@tonic-gate# We don't have anything to do; let user know and bail
2720Sstevel@tonic-gate#
2730Sstevel@tonic-gateif [ ! -n "${printer}" -a ! -n "${delete}" -a ! -n "${local}" ] ; then
2740Sstevel@tonic-gate	gettext "lpadmin: ERROR: Nothing to do.\n" 1>&2
2750Sstevel@tonic-gate	gettext "        TO FIX: You must give one of these options:\n" 1>&2
2760Sstevel@tonic-gate	gettext "		      -p, -d, -x -S\n" 1>&2
2770Sstevel@tonic-gate	exit 1
2780Sstevel@tonic-gatefi
2790Sstevel@tonic-gate
2800Sstevel@tonic-gate#
2810Sstevel@tonic-gate#       Printer does not exist
2820Sstevel@tonic-gate#       To be consistent with 2.5, assume adding local printer
2830Sstevel@tonic-gate#
2840Sstevel@tonic-gateif [ ! -n "${device}" -a ! -n "${server}" -a ! -n "${delete}" \
2850Sstevel@tonic-gate					 -a ! -n "${local}" ] ; then
2860Sstevel@tonic-gate	${LPGET} "${printer}" > /dev/null 2>&1
2870Sstevel@tonic-gate	lpget_stat=$?
2880Sstevel@tonic-gate	if [ ${lpget_stat} -ne 0 ] ; then
2890Sstevel@tonic-gate		gettext "lpadmin: ERROR: Missing -U or -v option.\n" 1>&2
2900Sstevel@tonic-gate		gettext "           TO FIX: Local printers must have\n" 1>&2
2910Sstevel@tonic-gate		gettext "                   a port defined (-v option) or\n" 1>&2
2920Sstevel@tonic-gate		gettext "                   have dial-out instructions (-U option).\n" 1>&2
2930Sstevel@tonic-gate		exit 1
2940Sstevel@tonic-gate	fi
2950Sstevel@tonic-gatefi
2960Sstevel@tonic-gate
2970Sstevel@tonic-gate#
2980Sstevel@tonic-gate#	Do the LP configuration for a local printer served by lpsched
2990Sstevel@tonic-gate#
3000Sstevel@tonic-gateif [ -f /usr/lib/lp/local/$cmd_name ] ; then
3010Sstevel@tonic-gate	if [ -f /etc/lp/printers/${printer}/configuration -o -n "${device}" -o \
3020Sstevel@tonic-gate	     -f /etc/lp/classes/${printer} -o -n "${local}" ] ; then
3030Sstevel@tonic-gate		# to deal with multi-word arguments
3040Sstevel@tonic-gate		CMD="/usr/lib/lp/local/$cmd_name"
3050Sstevel@tonic-gate		while [ -n "$*" ] ; do
3060Sstevel@tonic-gate			CMD="$CMD \"$1\""
3070Sstevel@tonic-gate			shift
3080Sstevel@tonic-gate		done
3090Sstevel@tonic-gate		case "$CMD" in
3100Sstevel@tonic-gate			*\"-D\")
3110Sstevel@tonic-gate				CMD="$CMD \"\""
3120Sstevel@tonic-gate			;;
3130Sstevel@tonic-gate		esac
3140Sstevel@tonic-gate		# if adding a printer, make sure scheduler is running
3150Sstevel@tonic-gate		if [ -n "${printer}" -a ! -n "${delete}" -a \
3160Sstevel@tonic-gate		    ! -p /var/spool/lp/fifos/FIFO ]; then
317*831Swendyp			svcadm enable -s svc:/application/print/server:default
3180Sstevel@tonic-gate		fi
3190Sstevel@tonic-gate		eval $CMD
3200Sstevel@tonic-gate		exit_code=$?
3210Sstevel@tonic-gate	fi
3220Sstevel@tonic-gatefi
3230Sstevel@tonic-gate
3240Sstevel@tonic-gateif [ $exit_code != 0 ] ; then
3250Sstevel@tonic-gate	exit $exit_code
3260Sstevel@tonic-gatefi
3270Sstevel@tonic-gate
3280Sstevel@tonic-gate
3290Sstevel@tonic-gate#	split the "server" into printer and server
3300Sstevel@tonic-gateif [ -n "${server}" ] ; then
331*831Swendyp	if [ `echo ${server} | /bin/grep -c !` = 1 ] ; then
3320Sstevel@tonic-gate		rem_printer=`echo ${server} | cut -d! -f2`
3330Sstevel@tonic-gate	fi
3340Sstevel@tonic-gate	server=`echo ${server} | cut -d! -f1`
3350Sstevel@tonic-gatefi
3360Sstevel@tonic-gate
3370Sstevel@tonic-gateif [ -z "${rem_printer}" ] ; then
3380Sstevel@tonic-gate	rem_printer=${printer}
3390Sstevel@tonic-gatefi
3400Sstevel@tonic-gate
3410Sstevel@tonic-gate
3420Sstevel@tonic-gate
3430Sstevel@tonic-gate#
3440Sstevel@tonic-gate#	Do the Solstice Print Configuration in /etc
3450Sstevel@tonic-gate#
3460Sstevel@tonic-gateif [ ! -f ${LPSET} -o ! -f ${LPGET} ] ; then
3470Sstevel@tonic-gate	exit_code=2
3480Sstevel@tonic-gateelse
3490Sstevel@tonic-gate	if [ -n "${delete}" ] ; then
3500Sstevel@tonic-gate		if [ "${delete}" = "all" ] ; then
3510Sstevel@tonic-gate			delete_entries
3520Sstevel@tonic-gate   		else
3530Sstevel@tonic-gate   			${LPSET} -n system -x ${delete}
3540Sstevel@tonic-gate   			exit_code=$?
3550Sstevel@tonic-gate			delete_local
3560Sstevel@tonic-gate   		fi
3570Sstevel@tonic-gate	fi
3580Sstevel@tonic-gate
3590Sstevel@tonic-gate	if [ -n "${printer}" -a -n "${server}" ] ; then
3600Sstevel@tonic-gate		${LPSET} -n system \
3610Sstevel@tonic-gate			-a "bsdaddr=${server},${rem_printer},Solaris" \
3620Sstevel@tonic-gate			${printer}
3630Sstevel@tonic-gate		exit_code=$?
3640Sstevel@tonic-gate	fi
3650Sstevel@tonic-gate	if [ -n "${printer}" -a -n "${description}" ] ; then
3660Sstevel@tonic-gate		${LPSET} -n system -a "description=${description}" ${printer}
3670Sstevel@tonic-gate		exit_code=$?
3680Sstevel@tonic-gate	fi
3690Sstevel@tonic-gate
3700Sstevel@tonic-gate#	Add class for local printers only
3710Sstevel@tonic-gate
3720Sstevel@tonic-gate	if [ -n "${class}" -a -n "${printer}" \
3730Sstevel@tonic-gate		-a -f /etc/lp/printers/${printer}/configuration ] ; then
3740Sstevel@tonic-gate
3750Sstevel@tonic-gate		${LPGET} "${class}" > /dev/null 2>&1
3760Sstevel@tonic-gate		lpget_class=$?
3770Sstevel@tonic-gate
3780Sstevel@tonic-gate#		If the class doesn't already exist in printers.conf, add it.
3790Sstevel@tonic-gate
380*831Swendyp		if [ -n "${server}" ] ; then
381*831Swendyp			CHOST=$server
382*831Swendyp		else
383*831Swendyp			CHOST=$HOST
384*831Swendyp		fi
3850Sstevel@tonic-gate		if [ ${lpget_class} -ne 0 ] ; then
3860Sstevel@tonic-gate			${LPSET} -n system \
387*831Swendyp				-a "bsdaddr=${CHOST},${class},Solaris" ${class}
3880Sstevel@tonic-gate			exit_code=$?
3890Sstevel@tonic-gate		fi
3900Sstevel@tonic-gate	fi
3910Sstevel@tonic-gatefi
3920Sstevel@tonic-gate
3930Sstevel@tonic-gate# /usr/lib/lp/local/lpadmin has changed the database. This cleans up cruft in the
3940Sstevel@tonic-gate# /etc/printers.conf file that refers to deleted objects.
3950Sstevel@tonic-gate
3960Sstevel@tonic-gate	if [ -n "${pconflocalclean}" ] ; then
3970Sstevel@tonic-gate		delete_local
3980Sstevel@tonic-gate	fi
3990Sstevel@tonic-gate
4000Sstevel@tonic-gateexit $exit_code
401