components/foomatic/filters/Solaris/netstandard_foomatic
changeset 335 223d5bf98b72
equal deleted inserted replaced
334:38c78ad8b01e 335:223d5bf98b72
       
     1 #
       
     2 # CDDL HEADER START
       
     3 #
       
     4 # The contents of this file are subject to the terms of the
       
     5 # Common Development and Distribution License (the "License").
       
     6 # You may not use this file except in compliance with the License.
       
     7 #
       
     8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
       
     9 # or http://www.opensolaris.org/os/licensing.
       
    10 # See the License for the specific language governing permissions
       
    11 # and limitations under the License.
       
    12 #
       
    13 # When distributing Covered Code, include this CDDL HEADER in each
       
    14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
       
    15 # If applicable, add the following below this CDDL HEADER, with the
       
    16 # fields enclosed by brackets "[]" replaced with your own identifying
       
    17 # information: Portions Copyright [yyyy] [name of copyright owner]
       
    18 #
       
    19 # CDDL HEADER END
       
    20 #
       
    21 
       
    22 #
       
    23 # Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
       
    24 #
       
    25 
       
    26 ###########
       
    27 ##
       
    28 ## Network Standard printer interface program for foomatic.
       
    29 ##
       
    30 ###########
       
    31 
       
    32 #####
       
    33 # We can't do much except exit if spooler/scheduler
       
    34 # cancels us.
       
    35 #####
       
    36 trap 'eval exit_clean 15' 15
       
    37 
       
    38 ####
       
    39 #
       
    40 # Send standard error messages to /dev/null rather than to
       
    41 # the spooler. Avoids "Terminated" messages that shell puts out
       
    42 # when gets SIGTERM. Save standard error so it can be used
       
    43 # when we need it
       
    44 ####
       
    45 exec 5>&2 2>/dev/null 3>&1
       
    46 
       
    47 ####
       
    48 # set some global variables
       
    49 ####
       
    50 
       
    51 : ${LPTMPDIR:=/tmp}
       
    52 : ${SPOOLDIR:=/usr/spool/lp}
       
    53 : ${LOCALPATH:=${SPOOLDIR}/bin}
       
    54 PATH="/bin:/usr/bin:${LOCALPATH}"
       
    55 exit_code=0
       
    56 
       
    57 
       
    58 # ${LPTELL} is the name of a program that will send its
       
    59 # standard input to the Spooler. It is used to forward
       
    60 # the description of a printer fault to the Spooler,
       
    61 # which uses it in an alert to the administrator.
       
    62 #####
       
    63 if [ ! -x "${LPTELL:=${LOCALPATH}/lp.tell}" ]
       
    64 then
       
    65         fake_lptell () {
       
    66                 header="no"
       
    67                 while read line
       
    68                 do
       
    69                         if [ "no" = "${header}" ]
       
    70                         then
       
    71                                 errmsg ERROR ${E_IP_UNKNOWN} \
       
    72                 "unknown printer/interface failure" \
       
    73                 "consult your system administrator;
       
    74                 reasons for failure (if any) follow:"
       
    75                                 header=yes
       
    76                         fi
       
    77                         echo "${line}" >&2
       
    78                 done
       
    79                 return 1
       
    80         }
       
    81         LPTELL=fake_lptell
       
    82 fi       
       
    83  
       
    84 #####
       
    85 # Error message formatter:
       
    86 #
       
    87 # Invoke as
       
    88 #
       
    89 #       errmsg severity message-number problem help
       
    90 #                                                   
       
    91 # where severity is "ERROR" or "WARNING", message-number is
       
    92 # a unique identifier, problem is a short description of the
       
    93 # problem, and help is a short suggestion for fixing the problem.
       
    94 #####
       
    95  
       
    96 LP_ERR_LABEL="UX:lp"
       
    97 E_IP_ARGS=1
       
    98 E_IP_OPTS=2
       
    99 #E_IP_FILTER=3
       
   100 E_IP_UNKNOWN=5
       
   101 E_IP_BADFILE=6
       
   102 E_IP_ERRORS=12 	# (in slow.filter)
       
   103  
       
   104 errmsg () {
       
   105 
       
   106         case $1 in
       
   107         ERROR )
       
   108                 sev="  ERROR";
       
   109                 ;;
       
   110         WARNING )
       
   111                 sev="WARNING";
       
   112                 ;;
       
   113         esac
       
   114 
       
   115         echo "${LP_ERR_LABEL}:$2 ${sev}: $3
       
   116         TO FIX: $4" >&5
       
   117 }                       
       
   118  
       
   119 ###########
       
   120 ##
       
   121 ## Check arguments
       
   122 ###########
       
   123  
       
   124 parse () {
       
   125         echo "`expr \"$1\" : \"^[^=]*=\(.*\)\"`"
       
   126 }         
       
   127  
       
   128 #####
       
   129 ##
       
   130 ## Error Cleanup and Exit
       
   131 ##
       
   132 #####
       
   133 
       
   134 exit_clean()
       
   135 {
       
   136 
       
   137 	if [ -f "${LPTMPDIR}/pr_eexit_code.$$" ]
       
   138 	then
       
   139 		/bin/rm ${LPTMPDIR}/pr_eexit_code.$$
       
   140 	fi
       
   141 
       
   142 	if [ -f "${LPTMPDIR}/small_banner.$$" ]
       
   143 	then
       
   144 		/bin/rm ${LPTMPDIR}/small_banner.$$
       
   145 	fi
       
   146 
       
   147 	if [ -f "${tmpfile}" ]
       
   148 	then
       
   149 		/bin/rm "${tmpfile}"
       
   150 	fi
       
   151 
       
   152 	exit $1
       
   153 }
       
   154 
       
   155 #####
       
   156 #
       
   157 # This program is invoked as
       
   158 #
       
   159 # ${SPOOLDIR}/.../printer request-id user title copies options files...
       
   160 #
       
   161 # The first three arguments are simply reprinted on the banner page,
       
   162 # the fourth (copies) is used to control the number of copies to print,
       
   163 # the fifth (options) is a blank separated list (in a single argument)
       
   164 # of user or Spooler supplied options (without the -o prefix),
       
   165 # and the last arguments are the files to print.
       
   166 #####
       
   167  
       
   168 if [ $# -lt 5 ]
       
   169 then
       
   170 
       
   171         errmsg ERROR ${E_IP_ARGS} \
       
   172                 "wrong number of arguments to interface program" \
       
   173                 "consult your system administrator"
       
   174         exit 1
       
   175 fi      
       
   176  
       
   177 printer=`basename $0`
       
   178 request_id=$1
       
   179 user_name=$2
       
   180 title=$3
       
   181 copies=$4
       
   182 option_list=$5
       
   183  
       
   184 shift 5
       
   185 files="$*"
       
   186 
       
   187 
       
   188 #
       
   189 # debug sent to file if defined in /etc/syslog.conf
       
   190 # syslog.conf entry: 
       
   191 #	lpr.debug	/path/filename
       
   192 #
       
   193 logger -p lpr.debug -t "netstandard_foomatic: ${request_id}" " "
       
   194 logger -p lpr.debug -t "netstandard_foomatic: ${request_id}" "INPUT"
       
   195 logger -p lpr.debug -t "netstandard_foomatic: ${request_id}" "    printer : ${printer}"
       
   196 logger -p lpr.debug -t "netstandard_foomatic: ${request_id}" "    request_id : ${request_id}"
       
   197 logger -p lpr.debug -t "netstandard_foomatic: ${request_id}" "    user_name : ${user_name}"
       
   198 logger -p lpr.debug -t "netstandard_foomatic: ${request_id}" "    title : ${title}"
       
   199 logger -p lpr.debug -t "netstandard_foomatic: ${request_id}" "    copies : ${copies}"
       
   200 logger -p lpr.debug -t "netstandard_foomatic: ${request_id}" "    option_list : ${option_list}"
       
   201 logger -p lpr.debug -t "netstandard_foomatic: ${request_id}" "    files : ${files}"
       
   202 logger -p lpr.debug -t "netstandard_foomatic: ${request_id}" "	 spooler_key ${SPOOLER_KEY}"
       
   203 
       
   204 ####
       
   205 # default: do print a banner
       
   206 ####
       
   207 nobanner=no
       
   208 nofilebreak="no"
       
   209 inlist=
       
   210 data_file_flag=
       
   211 
       
   212 for i in ${option_list}
       
   213 do
       
   214         case "${inlist}${i}" in
       
   215 
       
   216         nobanner )
       
   217                 nobanner="yes"
       
   218                 ;;
       
   219 
       
   220         nofilebreak )
       
   221                 nofilebreak="yes"
       
   222                 ;;
       
   223 
       
   224         #####
       
   225         #
       
   226         # If you want to add simple options (e.g. -o simple)
       
   227         # identify them here.
       
   228         #####
       
   229 #       simple )
       
   230 #               simple="yes"
       
   231 # 		;;
       
   232                    
       
   233         cpi=pica )
       
   234                 cpi=10
       
   235                 ;;
       
   236         cpi=elite )
       
   237                 cpi=12
       
   238                 ;; 
       
   239         cpi=* )
       
   240                 cpi=`parse ${i}`
       
   241                 ;;
       
   242  
       
   243         lpi=* )
       
   244                 lpi=`parse ${i}`
       
   245                 ;;
       
   246  
       
   247         length=* )
       
   248                 length=`parse ${i}`
       
   249                 ;;
       
   250  
       
   251         width=* )
       
   252                 width=`parse ${i}`
       
   253                 ;;
       
   254         dest=* )
       
   255                 dest="-d `parse ${i}`"
       
   256                 ;;
       
   257 
       
   258         protocol=* )
       
   259                 protocol="-P `parse ${i}`"
       
   260                 ;;
       
   261         bsdctrl=* )
       
   262 		controlfile="-c `parse ${i}`"
       
   263                 ;;
       
   264         timeout=* )
       
   265                 timeout="-t `parse ${i}`"
       
   266                 ;;
       
   267 
       
   268         data-file-type=* )
       
   269                 data_file_flag="-f `parse ${i}`"
       
   270                 ;;
       
   271 
       
   272 	#
       
   273 	# The IPP/PAPI attributes are handled by the foomatic-rip filter so
       
   274 	# all we need to do here is ignore them so that they don't invoke the
       
   275 	# "unrecognized option" message.
       
   276 	#
       
   277 
       
   278 	finishing=* | page-ranges=* | sides=* )
       
   279 		;;
       
   280 	number-up=* | orientation-requested=* | media=* )
       
   281 		;;
       
   282 	printer-resolution=* | print-quality=* )
       
   283 		;;
       
   284 
       
   285         #####
       
   286         #
       
   287         # If you want to add simple-value options (e.g. -o value=a)
       
   288         # identify them here.
       
   289         #####
       
   290 #       value=* )
       
   291 #		value=`parse ${i}`
       
   292 #		;;
       
   293 
       
   294         #####
       
   295         #
       
   296         # If you want to add options that, 
       
   297         # take a list (e.g. -o lopt='a b c'), identif
       
   298         # them here and below (look for LOPT).
       
   299         #####
       
   300                                    
       
   301 #	flist=* | lpd=* | options=* )
       
   302         flist=* | lpd=* )
       
   303 #LOPT   stty=* | flist=* | lpd=* | lopt=* )    
       
   304 
       
   305                 inlist=`expr "${inlist}${i}" : "^\([^=]*=\)"`
       
   306                 case "${i}" in
       
   307                 ${inlist}\'*\' )
       
   308                         item=`expr "${i}" : "^[^=]*='*\(.*\)'\$"`
       
   309                         ;;
       
   310                 ${inlist}\' )
       
   311                         continue
       
   312                         ;;
       
   313                 ${inlist}\'* )
       
   314                         item=`expr "${i}" : "^[^=]*='*\(.*\)\$"`
       
   315                         ;;
       
   316                 ${inlist}* )
       
   317                         item=`expr "${i}" : "^[^=]*=\(.*\)\$"`
       
   318                         ;;
       
   319                 *\' )
       
   320                         item=`expr "${i}" : "^\(.*\)'\$"`
       
   321                         ;;
       
   322                 * )
       
   323                         item="${i}"
       
   324                         ;;
       
   325                 esac
       
   326 
       
   327                 #####
       
   328                 #
       
   329                 # We don't dare use "eval" because a clever user could
       
   330                 # put something in an option value that we'd end up
       
   331                 # exec'ing.
       
   332                 #####
       
   333                 case "${inlist}" in
       
   334                 flist= )
       
   335                         flist="${flist} ${item}"
       
   336                         ;;
       
   337                 lpd= )
       
   338                         lpd="${lpd} ${item}"
       
   339                         ;;
       
   340 #LOPT		lopt= )
       
   341 #LOPT                   lopt="${lopt} ${item}"
       
   342 #LOPT			;;
       
   343 #		options= )
       
   344 #			options="${options} ${item}"
       
   345 #			;;
       
   346                 esac
       
   347                      
       
   348                 case "${i}" in
       
   349                 ${inlist}\'*\' )
       
   350                         inlist=
       
   351                         ;;
       
   352                 ${inlist}\'* )
       
   353                         ;;
       
   354                 *\' | ${inlist}* )
       
   355                         inlist=
       
   356                         ;;
       
   357                 esac
       
   358                 ;;
       
   359 
       
   360         * )
       
   361                 ;;
       
   362         esac
       
   363 done         
       
   364 
       
   365 logger -p lpr.debug -t "netstandard_foomatic: ${request_id}"  "term : ${TERM}"
       
   366 
       
   367 if [ -z "${FILTER}" ]
       
   368 then
       
   369         #####
       
   370         #
       
   371         # If no filter is being used, we use netpr to push the
       
   372 	# file to the printer.
       
   373         # (QUOTES ARE IMPORTANT!)
       
   374         #####
       
   375 
       
   376         case "$TERM" in
       
   377                 PS )
       
   378                         # make the "postscript" printers use netpr 
       
   379                         FILTER=
       
   380                 ;;
       
   381                 PSR )
       
   382                         # make the "reverse postscript" printers reverse the
       
   383                         # output and the use postio to talk to the printer
       
   384                         #FILTER="/usr/lib/lp/postscript/postreverse "
       
   385                         #FILTER=
       
   386                         FILTER="/usr/lib/lp/postscript/postreverse "
       
   387                 ;;
       
   388                 * )
       
   389                         # We don't know the type, so just assume that the
       
   390                         # input and output are the same. Use netpr.
       
   391                         #FILTER=/bin/cat
       
   392 			FILTER=
       
   393                 ;;
       
   394         esac
       
   395 fi
       
   396  
       
   397 ####
       
   398 # sets default value for ordering of data and control files with
       
   399 # bsd protocol. Default: data files first. Administrator
       
   400 # may set to control file first with lpadmin -o bsdctrl=first
       
   401 ####
       
   402 
       
   403 banner_flag=""
       
   404 case "${nobanner}" in
       
   405 	yes )
       
   406 		banner_flag="-b"
       
   407 	;;
       
   408 esac
       
   409 
       
   410 NETPR="/usr/lib/lp/bin/netpr ${banner_flag} ${data_file_flag} \
       
   411 	-I ${request_id} -U ${user_name} \
       
   412 	-p ${printer} ${dest} -T \"${title}\"  \
       
   413 	${timeout}  ${protocol} ${controlfile} "
       
   414 LPTELL_OPTS="-l"	# netpr sends LaserWriter style messages back
       
   415 PPDFILTER=/usr/lib/lp/bin/foomatic-rip
       
   416 PPDFILTERA="${PPDFILTER} ${request_id} ${user_name} \"${title}\" ${copies} \"${option_list}\""
       
   417 
       
   418 logger -p lpr.debug -t "netstandard_foomatic: ${request_id}" "NETPR= ${NETPR}"
       
   419 logger -p lpr.debug -t "netstandard_foomatic: ${request_id}" "filter : ${FILTER}"
       
   420 logger -p lpr.debug -t "netstandard_foomatic: ${request_id}" "ppdfilter : ${PPDFILTERA}"
       
   421 
       
   422 node=`uname -n`
       
   423 pid=$$
       
   424 tmpfile=${LPTMPDIR}/${node}.${pid}
       
   425 tmpfilefoo=${LPTMPDIR}/${node}.${pid}.1
       
   426 
       
   427 logger -p lpr.debug -t "netstandard_foomatic: ${request_id}" "tmpfile : ${tmpfile}"
       
   428  
       
   429 #####
       
   430 #
       
   431 # Set up filter for banner page
       
   432 #
       
   433 #####
       
   434 banner_filter=
       
   435 case "${TERM}" in
       
   436 PS | PSR )
       
   437 	banner_filter=" | /usr/lib/lp/postscript/postprint "
       
   438 	LPTELL_OPTS="-l"
       
   439 	;;
       
   440 esac 
       
   441 
       
   442 #####
       
   443 #
       
   444 # Build temporary file that is the banner page
       
   445 #
       
   446 #####
       
   447 PAD="#####${NL}"
       
   448 CR="\r"
       
   449 NL="${CR}\n"
       
   450 FF=
       
   451 
       
   452 small_banner() {
       
   453         echo "${CR}\c"
       
   454         echo "${PAD}\c"
       
   455         echo "#####  User: ${user_name}${NL}\c"
       
   456         if [ -n "${title}" ]
       
   457         then
       
   458                 echo "##### Title: ${title}${NL}\c"
       
   459         fi
       
   460         echo "#####  Date: `LANG=C date '+%a %H:%M %h %d, %Y'`${NL}\c"
       
   461         echo "#####   Job: ${request_id}${NL}\c"
       
   462         echo "${PAD}\c"
       
   463         if [ -n "${FF}" ]
       
   464         then
       
   465                 echo "${CR}${FF}\c"
       
   466         fi
       
   467 }
       
   468 
       
   469 #####
       
   470 #
       
   471 # Doing small banner as we don't know what printer is out there
       
   472 #
       
   473 #####
       
   474 banner=small_banner
       
   475 
       
   476 if [ "no" = "${nobanner}" ]
       
   477 then
       
   478 	eval "${banner} ${banner_filter}" 2>&1 1>${LPTMPDIR}/small_banner.$$ 
       
   479 fi
       
   480 
       
   481 #####
       
   482 #
       
   483 # Print banner page before job unless PSR
       
   484 #
       
   485 #####
       
   486 
       
   487 
       
   488 if [ "no" = "${nobanner}" -a "${TERM}" != "PSR" ]
       
   489 then
       
   490 	(
       
   491 		eval ${NETPR} ${LPTMPDIR}/small_banner.$$ 2>&1
       
   492 		echo $? > ${LPTMPDIR}/pr_eexit_code.$$
       
   493 	) | ${LPTELL} ${LPTELL_OPTS} ${printer}
       
   494 
       
   495 	exit_code=`cat ${LPTMPDIR}/pr_eexit_code.$$`
       
   496 	logger -p lpr.debug -t "netstandard_foomatic: ${request_id}"	\
       
   497 		"banner page exit code : ${exit_code}"
       
   498 
       
   499 fi
       
   500 
       
   501 i=1
       
   502 while [ $i -le $copies ]
       
   503 do
       
   504         for file in ${files}
       
   505         do
       
   506                 if [ -r "${file}" ]
       
   507                 then
       
   508 
       
   509 			if [ ! -z "${FILTER}" ]
       
   510 			then
       
   511  				(
       
   512 					#####
       
   513 					# There is a filter, use it
       
   514 					#
       
   515 					# Put 0<${file} before the "eval" to keep
       
   516 					# clever users from giving a file name that
       
   517 					# evaluates as something to execute.
       
   518 					# Redirect stderr to stdout so LPTELL will
       
   519 					# get error messages from pipe. 
       
   520 					#####
       
   521 
       
   522 					0<${file} eval ${FILTER} 2>&1 1>${tmpfile}
       
   523 					echo $? > ${LPTMPDIR}/pr_eexit_code.$$
       
   524 				) | ${LPTELL} ${LPTELL_OPTS} ${printer}
       
   525 
       
   526 				exit_code=`cat ${LPTMPDIR}/pr_eexit_code.$$`
       
   527 				logger -p lpr.debug -t "netstandard_foomatic: ${request_id}" \
       
   528 					"filter exit_code : ${exit_code}"
       
   529 
       
   530  			 	if [ -n "${exit_code}" ]
       
   531  				then
       
   532 					if [ "${exit_code}" -eq 0 ]
       
   533 					then
       
   534 						printfile=${tmpfile}
       
   535 					else
       
   536 						####
       
   537 						# The filter did not succeed, so don't try to print
       
   538 						####
       
   539 							printfile=
       
   540 					fi
       
   541 				fi
       
   542 
       
   543 			else
       
   544 				printfile=${file}
       
   545 			fi
       
   546 
       
   547 			logger -p lpr.debug -t "netstandard_foomatic: ${request_id}" \
       
   548 				"printfile : ${printfile}"
       
   549 			
       
   550 			#####
       
   551 			# Print the file
       
   552 			#####
       
   553 
       
   554 			if [ -r "${printfile}" ]
       
   555 			then
       
   556 				(
       
   557 logger -p lpr.debug -t "@1 netstandard_foomatic: printfile = ${printfile}" ""
       
   558 logger -p lpr.debug -t "netstandard_foomatic: ${NETPR} ${printfile}" ""
       
   559 					#eval ${NETPR} ${printfile} 2>&1
       
   560 					cat ${printfile} | ${PPDFILTER} \
       
   561 	      ${request_id} ${user_name} "${title}" ${copies} "${option_list}" \
       
   562 						> ${tmpfilefoo} 2> /dev/null
       
   563 					eval ${NETPR} ${tmpfilefoo} 2>&1
       
   564 					echo $? > ${LPTMPDIR}/pr_eexit_code.$$
       
   565 					/bin/rm -f ${tmpfilefoo}
       
   566 				) | ${LPTELL} ${LPTELL_OPTS} ${printer}
       
   567 
       
   568 				exit_code=`cat ${LPTMPDIR}/pr_eexit_code.$$`
       
   569 				logger -p lpr.debug -t "@2 netstandard_foomatic: ${request_id}" \
       
   570 					"netpr exit_code : ${exit_code}"
       
   571 
       
   572 				if [ -f "${tmpfile}" ]
       
   573 				then
       
   574 					/bin/rm "${tmpfile}"
       
   575 				fi
       
   576 
       
   577 				if [ -n "${exit_code}" ]
       
   578 				then
       
   579 					if [ "${exit_code}" -eq 0 ]
       
   580 					then
       
   581 						printone=yes
       
   582 					else
       
   583 						if [ "${exit_code}" -lt 128 ]
       
   584 						then
       
   585 							noprint=yes
       
   586 						else
       
   587 							retry=yes
       
   588 						fi
       
   589 					fi
       
   590 				fi
       
   591 				
       
   592 
       
   593 			else	
       
   594 
       
   595 				errmsg WARNING ${E_IP_BADFILE} \
       
   596 				"cannot read temporary file \"${printfile}\""\
       
   597 					"see if file still exists,
       
   598 			or consult your system administrator;
       
   599 			printing continues"
       
   600 
       
   601 			fi
       
   602 		else
       
   603 
       
   604                         #####
       
   605                         #
       
   606                         # Don't complain about not being able to read
       
   607                         # a file on second and subsequent copies, unless
       
   608                         # we've not complained yet. This removes repeated
       
   609                         # messages about the same file yet reduces the
       
   610                         # chance that the user can remove a file and not
       
   611                         # know that we had trouble finding it.
       
   612                         #####
       
   613 
       
   614                         if [ "${i}" -le 1 -o -z "${badfileyet}" ]
       
   615                         then
       
   616                                 errmsg WARNING ${E_IP_BADFILE} \
       
   617                                         "cannot read file \"${file}\"" \
       
   618                                         "see if the file still exists and is readable,
       
   619                 or consult your system administrator;
       
   620                 printing continues"
       
   621                                 badfileyet=yes
       
   622                         fi
       
   623 
       
   624 		fi
       
   625 
       
   626 # for file in ${files}
       
   627 	done
       
   628 	i=`expr $i + 1`
       
   629 done
       
   630 
       
   631 #####
       
   632 #
       
   633 # If printing in reverse order, print the banner page now
       
   634 #
       
   635 #####
       
   636 
       
   637 if [ "no" = "${nobanner}" -a "${TERM}" = "PSR" ]
       
   638 then
       
   639 (
       
   640 	eval ${NETPR} ${LPTMPDIR}/small_banner.$$ 2>&1
       
   641 	echo $? > ${LPTMPDIR}/pr_eexit_code.$$
       
   642 ) | ${LPTELL} ${LPTELL_OPTS} ${printer}
       
   643 fi
       
   644 
       
   645 exit_code=`cat ${LPTMPDIR}/pr_eexit_code.$$`
       
   646 logger -p lpr.debug -t "netstandard_foomatic: ${request_id}"     \
       
   647                 "banner page exit code : ${exit_code}"
       
   648 
       
   649 if [ -n "${printone}" -a -z "${retry}" -a -z "${noprint}" ]
       
   650 then
       
   651        	exit_code=`expr 0`
       
   652 else
       
   653         if [ -n "${retry}" -a -z "${printone}" -a -z "${noprint}" ]
       
   654         then
       
   655                 exit_code=`expr 129`
       
   656         else
       
   657 		exit_code=`expr 1`
       
   658 	fi
       
   659 fi
       
   660 
       
   661 logger -p lpr.debug -t "netstandard_foomatic: ${request_id}" \
       
   662 	"FINAL exit_code : ${exit_code}"
       
   663 
       
   664 exit_clean ${exit_code}