lpadmin revision 5c88ba20fc79ecf19255b4a04f03d77630b6d0e7
2N/A# The contents of this file are subject to the terms of the 2N/A# Common Development and Distribution License, Version 1.0 only 2N/A# (the "License"). You may not use this file except in compliance 2N/A# See the License for the specific language governing permissions 2N/A# and limitations under the License. 2N/A# When distributing Covered Code, include this CDDL HEADER in each 2N/A# If applicable, add the following below this CDDL HEADER, with the 2N/A# fields enclosed by brackets "[]" replaced with your own identifying 2N/A# information: Portions Copyright [yyyy] [name of copyright owner] 2N/A# Copyright 2005 Sun Microsystems, Inc. All rights reserved. 2N/A# Use is subject to license terms. 2N/A# ident "%Z%%M% %I% %E% SMI" 2N/A gettext " lpadmin -S print-wheel -A alert-type [ -W minutes ]\n" 1>&2 2N/A gettext " lpadmin -M -f form-name [ -a [ -o filebreak ]\n" 1>&2 2N/A# Get printer names for each local printer 2N/A# get printer name from that line 2N/A# If there is not an entry for this printer in 2N/A gettext "Warning: error removing ${PRINTER} " 1>&2 2N/A# shutdown scheduler if there are no local printers 2N/A "Call to lpset -x _default exits with ${status}" 2N/A# Delete all the remote printers using bsdaddr 2N/A# Deal with the -d option independently since getopts does not handle 2N/A# options that may or may not have arguments 2N/A # check that there are no extra arguments 2N/A if [ -n
"${third}" ] ;
then 2N/A # be sure we have lpset and lpget 2N/A gettext "lpadmin: System error; cannot set default printer\n" 1>&
2 2N/A if [ ! -n
"${second}" ] ;
then 2N/A gettext "lpadmin: System error while trying to delete default printer\n" 1>&
2 2N/A # there was no _default, the work is done 2N/A echo "${second}: " 1>&
2 2N/A# Strip off legal options 2N/Awhile 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 2N/A if [ -n
"${delete}" ] ;
then 2N/A if [ ! -n
"${server}" ] ;
then 2N/A if [ -n
"${printer}" -o -n
"${server}" -o \
2N/A -n
"${device}" -o -n
"${description}" ] ;
then 2N/A gettext "lpadmin: System error; cannot set class\n " 1>&
2 2N/A gettext "lpadmin: ERROR: Can't create class ${class}.\n" 1>&
2 2N/A gettext " TO FIX: This is an existing printer name;\n" 1>&
2 2N/A# We don't have anything to do; let user know and bail 2N/Aif [ ! -n
"${printer}" -a ! -n
"${delete}" -a ! -n
"${local}" ] ;
then 2N/A gettext " TO FIX: You must give one of these options:\n" 1>&
2 2N/A# Printer does not exist 2N/A# To be consistent with 2.5, assume adding local printer 2N/Aif [ ! -n
"${device}" -a ! -n
"${server}" -a ! -n
"${delete}" \
2N/A -a ! -n
"${local}" ] ;
then 2N/A gettext "lpadmin: ERROR: Missing -U or -v option.\n" 1>&
2 2N/A gettext " TO FIX: Local printers must have\n" 1>&
2 2N/A gettext " have dial-out instructions (-U option).\n" 1>&
2 2N/A# Do the LP configuration for a local printer served by lpsched # to deal with multi-word arguments # if adding a printer, make sure scheduler is running if [ -n
"${printer}" -a ! -n
"${delete}" -a \
# split the "server" into printer and server if [ -n
"${server}" ] ;
then if [ -z
"${rem_printer}" ] ;
then # Do the Solstice Print Configuration in /etc if [ -n
"${delete}" ] ;
then if [
"${delete}" =
"all" ] ;
then if [ -n
"${printer}" -a -n
"${server}" ] ;
then -a
"bsdaddr=${server},${rem_printer},Solaris" \
if [ -n
"${printer}" -a -n
"${description}" ] ;
then # Add class for local printers only if [ -n
"${class}" -a -n
"${printer}" \
if [ -n
"${server}" ] ;
then -a
"bsdaddr=${CHOST},${class},Solaris" ${
class}
if [ -n
"${pconflocalclean}" ] ;
then