home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / usr / bin / foo2lava-wrapper < prev    next >
Encoding:
Text File  |  2007-03-27  |  14.3 KB  |  592 lines

  1. #!/bin/sh
  2.  
  3. #* Copyright (C) 2003-2006  Rick Richardson
  4. #*
  5. #* This program is free software; you can redistribute it and/or modify
  6. #* it under the terms of the GNU General Public License as published by
  7. #* the Free Software Foundation; either version 2 of the License, or
  8. #* (at your option) any later version.
  9. #*
  10. #* This program is distributed in the hope that it will be useful,
  11. #* but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. #* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. #* GNU General Public License for more details.
  14. #*
  15. #* You should have received a copy of the GNU General Public License
  16. #* along with this program; if not, write to the Free Software
  17. #* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18. #*
  19. #* Authors: Rick Richardson <rick.richardson@comcast.net>
  20.  
  21. VERSION='$Id: foo2lava-wrapper.in,v 1.11 2006/12/23 14:20:22 rick Exp $'
  22.  
  23. #
  24. # Printer Notes:
  25. #
  26. # Konica Minolta 2530 DL
  27. #
  28.  
  29. PROGNAME="$0"
  30. BASENAME=`basename $PROGNAME`
  31. PREFIX=/usr
  32. SHARE=$PREFIX/share/foo2lava
  33.  
  34. #
  35. #    Log the command line, for debugging and problem reports
  36. #
  37. if [ -x /usr/bin/logger ]; then
  38.     logger -t "$BASENAME" -p lpr.info -- "foo2lava-wrapper $@" </dev/null
  39. fi
  40.  
  41. usage() {
  42.     cat <<EOF
  43. Usage:
  44.     $BASENAME [options] [ps-file]
  45.  
  46.     Foomatic printer wrapper for the foo2lava printer driver.
  47.     This script reads a Postscript ps-file or standard input
  48.     and converts it to LAVAFLOW printer format.
  49.  
  50. Normal Options:
  51. -c                Print in color (else monochrome)
  52. -d duplex         Duplex code to send to printer [$DUPLEX]
  53.                     1=off, 2=longedge, 3=shortedge
  54. -m media          Media code to send to printer [$MEDIA]
  55.                     1=standard 4=transparency 20=thick stock 22=envelope
  56.                     23=letterhead 25=postcard 26=labels 27=recycled
  57.                     28=glossy
  58. -p paper          Paper code [$PAPER]
  59.                     1=executive 2=letter 3=legal 25=A5 26=A4 45=B5jis
  60.                     65=B5iso 80=envMonarch 81=env#10 90=envDL 91=envC5
  61.                     92=envC6 835=4x6\" 837=10x15cm
  62. -n copies         Number of copies [$COPIES]
  63. -r <xres>x<yres>  Set device resolution in pixels/inch [$RES]
  64. -s source         Source code to send to printer [$SOURCE]
  65.                     1=upper, 2=lower, 4=manual, 7=auto
  66.             Code numbers may vary with printer model.
  67. -t                Draft mode.  Every other pixel is white.
  68. -2/-3/-4/-6/-8/-10/-12/-14/-15/-16/-18
  69.                   Print with N-up (requires psutils)
  70. -o orient         For N-up: -op is portrait, -ol is landscape, -os is seascape.
  71.  
  72. Printer Tweaking Options:
  73. -u <xoff>x<yoff>  Set offset of upper left printable in pixels [varies]
  74. -l <xoff>x<yoff>  Set offset of lower right printable in pixels [varies]
  75. -L mask           Send logical clipping values from -u/-l in ZjStream [3]
  76.                   0=no, 1=Y, 2=X, 3=XY
  77. -P                Do not output START_PLANE codes.  May be needed by some
  78.                   monochrome-only printers.
  79. -X padlen         Add extra zero padding to the end of BID segments [16]
  80. -z model          Model: 0=2300DL 1=hp1020 [0]
  81.  
  82. Color Tweaking Options:
  83. -g gsopts         Additional options to pass to Ghostscript, such as
  84.                   -dDITHERPPI=nnn, etc.  May appear more than once. []
  85. -G profile.icm    Convert profile.icm to a Postscript CRD using icc2ps and
  86.                   adjust colors using the setcolorrendering PS operator.
  87.                   $SHARE/icm/ will be searched for profile.icm.
  88. -I intent         Select profile intent from ICM file [$INTENT]
  89.                   0=Perceptual, 1=Colorimetric, 2=Saturation, 3=Absolute
  90. -G gamma-file.ps  Prepend gamma-file to the Postscript input to perform
  91.                   color correction using the setcolortransfer PS operator.
  92.  
  93. Debugging Options:
  94. -S plane          Output just a single color plane from a color print [all]
  95.                   1=Cyan, 2=Magenta, 3=Yellow, 4=Black
  96. -D lvl            Set Debug level [$DEBUG]
  97. -V                $VERSION
  98. EOF
  99.  
  100.     exit 1
  101. }
  102.  
  103. #
  104. #       Report an error and exit
  105. #
  106. error() {
  107.     echo "$BASENAME: $1" >&2
  108.     exit 1
  109. }
  110.  
  111. dbgcmd() {
  112.     if [ $DEBUG -ge 1 ]; then
  113.         echo "$@" >&2
  114.     fi
  115.     "$@"
  116. }
  117.  
  118. #
  119. #    N-up-ify the job.  Requires psnup from psutils package
  120. #
  121. nup() {
  122.     case "$NUP" in
  123.     [2368]|1[0458])
  124.     tr '\r' '\n' | psnup $NUP_ORIENT -d2 -$NUP -m.3in -p$paper -q
  125.     ;;
  126.     [49]|1[26])
  127.     tr '\r' '\n' | psnup $NUP_ORIENT -d2 -$NUP -m.5in -p$paper -q
  128.     ;;
  129.     *)
  130.     error "Illegal call to nup()."
  131.     ;;
  132.     esac
  133. }
  134.  
  135. #
  136. #       Process the options
  137. #
  138.  
  139. # Try to use a local copy of GhostScript 8.14, if available.  Otherwise,
  140. # fallback to whatever the Linux distro has installed (usually 7.05)
  141. #
  142. # N.B. := operator used here, when :- would be better, because "ash"
  143. # doesn't have :-
  144. if gs8 -v >/dev/null 2>&1; then
  145.         GSBIN=${GSBIN:-gs8}
  146. else
  147.         GSBIN=${GSBIN:-gs}
  148. fi
  149.  
  150. CMDLINE="$*"
  151. DEBUG=0
  152. DUPLEX=1
  153. COLOR=
  154. COLORMODE=0
  155. MODEL=0
  156. # What mode to use if the user wants us to pick the "best" mode
  157. case `$GSBIN --version` in
  158. 7*)    DEFAULTCOLORMODE=10
  159.     DEFAULTCOLORMODE=2
  160.     DEFAULTCOLORMODE=10
  161.     ;;
  162. *)    DEFAULTCOLORMODE=2
  163.     DEFAULTCOLORMODE=10
  164.     ;;
  165. esac
  166. QUALITY=1
  167. MEDIA=0
  168. COPIES=1
  169. PAPER=2
  170. RES=1200x600
  171. SOURCE=255
  172. NUP=
  173. CLIP_UL=
  174. CLIP_LR=
  175. CLIP_LOG=
  176. BC=
  177. AIB=
  178. NOPLANES=
  179. COLOR2MONO=
  180. GAMMAFILE=
  181. INTENT=0
  182. GSOPTS=
  183. EXTRAPAD=
  184. SAVETONER=
  185. NUP_ORIENT=
  186. GSDEV=-sDEVICE=pbmraw
  187. while getopts "1:23456789o:b:cC:d:g:l:u:L:m:n:p:q:r:s:tz:ABS:D:G:I:PX:Vh?" opt
  188. do
  189.     case $opt in
  190.     b)    GSBIN="$OPTARG";;
  191.     c)    COLOR=-c;;
  192.     d)    DUPLEX="$OPTARG";;
  193.     g)    GSOPTS="$GSOPTS $OPTARG";;
  194.     m)    MEDIA="$OPTARG";;
  195.     n)    COPIES="$OPTARG";;
  196.     p)    PAPER="$OPTARG";;
  197.     q)    QUALITY="$OPTARG";;
  198.     r)    RES="$OPTARG";;
  199.     s)    SOURCE="$OPTARG";;
  200.     t)    SAVETONER="-t";;
  201.     z)    MODEL="$OPTARG";;
  202.     l)    CLIP_LR="-l $OPTARG";;
  203.     u)    CLIP_UL="-u $OPTARG";;
  204.     L)    CLIP_LOG="-L $OPTARG";;
  205.     A)    AIB=-A;;
  206.     B)    BC=-B;;
  207.     C)    COLORMODE="$OPTARG";;
  208.     S)    COLOR2MONO="-S$OPTARG";;
  209.     D)    DEBUG="$OPTARG";;
  210.     G)    GAMMAFILE="$OPTARG";;
  211.     I)    INTENT="$OPTARG";;
  212.     P)    NOPLANES=-P;;
  213.     X)    EXTRAPAD="-X $OPTARG";;
  214.     [234689])    NUP="$opt";;
  215.     [57])    error "Can't find acceptable layout for $opt-up";;
  216.     1)    case "$OPTARG" in
  217.         [024568])    NUP="1$OPTARG";;
  218.         *)    error "Can't find acceptable layout for 1$OPTARG-up";;
  219.         esac
  220.         ;;
  221.     o)    case "$OPTARG" in
  222.         l*)    NUP_ORIENT=-l;;
  223.         s*)    NUP_ORIENT=-r;;
  224.         p*|*)    NUP_ORIENT=;;
  225.         esac;;
  226.     V)    echo "$VERSION"; foo2lava -V; exit 0;;
  227.     h|\?)
  228.         if [ "$CMDLINE" != "-?" -a "$CMDLINE" != -h ]; then
  229.             echo "Illegal command:"
  230.             echo "    $0 $CMDLINE"
  231.             echo
  232.         fi
  233.         usage;;
  234.     esac
  235. done
  236. shift `expr $OPTIND - 1`
  237.  
  238. #
  239. case "$QUALITY" in
  240. 0)
  241.     GSOPTS="-dCOLORSCREEN $GSOPTS"
  242.     ;;
  243. 1)
  244.     GSOPTS="-dCOLORSCREEN $GSOPTS"
  245.     ;;
  246. 2)
  247.     GSOPTS="-dMaxBitMap=500000000 $GSOPTS"
  248.     ;;
  249. esac
  250.  
  251. #
  252. #    Validate model code
  253. #
  254. case "$MODEL" in
  255. 0|1)    ;;
  256. *)    error "Unknown model code $MODEL";;
  257. esac
  258.  
  259. #
  260. #    Validate media code
  261. #
  262. case "$MEDIA" in
  263. 0|plain)    MEDIA=0;;
  264. 4|transparency)    MEDIA=4;;
  265. 20|thickstock)    MEDIA=20;;
  266. 22|envelope)    MEDIA=22;;
  267. 23|letterhead)    MEDIA=23;;
  268. 25|postcard)    MEDIA=25;;
  269. 26|labels)    MEDIA=26;;
  270. 27|recycled)    MEDIA=27;;
  271. 28|glossy)    MEDIA=28;;
  272. [0-9]*)        ;;
  273. *)        error "Unknown media code $MEDIA";;
  274. esac
  275.  
  276. #
  277. #    Validate source (InputSlot) code
  278. #
  279. case "$SOURCE" in
  280. 1|tray1)    SOURCE=1;;
  281. 4|tray2)    SOURCE=4;;
  282. 255|auto)    SOURCE=255;;
  283. [0-9]*)        ;;
  284. *)        error "Unknown source code $SOURCE";;
  285. esac
  286.  
  287. #
  288. #    Validate Duplex code
  289. #
  290. case "$DUPLEX" in
  291. 1|off|none)    DUPLEX=1;;
  292. 2|long*)    DUPLEX=2;;
  293. 3|short*)    DUPLEX=3;;
  294. [0-9]*)        ;;
  295. *)        error "Unknown duplex code $DUPLEX";;
  296. esac
  297.  
  298. #
  299. #    Validate Resolution
  300. #
  301. case "$RES" in
  302. 600x600)    ;;
  303. 1200x600)    ;;
  304. 2400x600)    ;;
  305. *)        error "Illegal resolution $RES";;
  306. esac
  307.  
  308. #
  309. #    Figure out the paper dimensions in pixels/inch, and set the
  310. #    default clipping region.  Unfortunately, this is a trouble
  311. #    area for ZjStream printers.  Various versions of ZjS print
  312. #    engines react differently when asked to print into their
  313. #    unprintable regions.
  314. #
  315. set_clipping() {
  316.     ulx=$1; uly=$2
  317.     lrx=$3; lry=$4
  318.  
  319.     # Set clipping region if it isn't already set
  320.     if [ "$CLIP_UL" = "" ]; then
  321.     case "$RES" in
  322.     600x600)    ulx=`expr $ulx / 2`;;
  323.     2400x600)    ulx=`expr $ulx \* 2`;;
  324.     esac
  325.     CLIP_UL="-u ${ulx}x${uly}"
  326.     fi
  327.     if [ "$CLIP_LR" = "" ]; then
  328.     case "$RES" in
  329.     600x600)    lrx=`expr $lrx / 2`;;
  330.     2400x600)    lrx=`expr $lrx \* 2`;;
  331.     esac
  332.     CLIP_LR="-l ${lrx}x${lry}"
  333.     fi
  334. }
  335.  
  336. case "$PAPER" in
  337. 1|executive)    PAPER=1;    paper=executive; XDIM="8700";  YDIM="6300"
  338.         set_clipping 206 110    206 110
  339.         ;;
  340. 2|letter)    PAPER=2;    paper=letter;    XDIM="10200"; YDIM="6600"
  341.         set_clipping 204 100    204 100
  342.         ;;
  343. 3|legal)    PAPER=3;    paper=legal;     XDIM="10200"; YDIM="8400"
  344.         set_clipping 204 104    204 104
  345.         ;;
  346. 25|a5|A5)    PAPER=25;    paper=a5;        XDIM="6992";  YDIM="4960"
  347.         set_clipping 216 112    216 112
  348.         ;;
  349. 26|a4|A4)    PAPER=26;    paper=a4;        XDIM="9920";  YDIM="7016"
  350.         set_clipping 208 100    208 100
  351.         ;;
  352. 45|b5jis|B5jis)    PAPER=45;    paper=b5;        XDIM="8598";  YDIM="6070"
  353.         set_clipping 204 107    202 107
  354.         ;;
  355. 65|b5iso|B5iso)    PAPER=65;    paper=b5;        XDIM="8314";  YDIM="5906"
  356.         set_clipping 206 105    204 105
  357.         ;;
  358. 80|envMonarch)    PAPER=80;    paper=envMonarch;XDIM="4650";  YDIM="4500"
  359.         set_clipping 214 106    212 106
  360.         ;;
  361. 81|"env#10")    PAPER=81;    paper=env10;     XDIM="4950";  YDIM="5700"
  362.         set_clipping 204 114    202 114
  363.         ;;
  364. 90|envDL)    PAPER=90;    paper=envDL;     XDIM="5200";  YDIM="5200"
  365.         set_clipping 216 104    216 104
  366.         ;;
  367. 91|envC5)    PAPER=91;    paper=envC5;     XDIM="7650";  YDIM="5408"
  368.         set_clipping 210 112    208 112
  369.         ;;
  370. 92|envC6)    PAPER=92;    paper=envC6;     XDIM="5386";  YDIM="3826"
  371.         set_clipping 214 105    212 105
  372.         ;;
  373. 835|photo4x6)    PAPER=835;    paper=photo4x6;  XDIM="4800";  YDIM="3600"
  374.         set_clipping 224 104    224 104
  375.         ;;
  376. 837|photo10x15)    PAPER=837;    paper=photo10x15; XDIM="4818";  YDIM="3590"
  377.         # Actually, 102x152
  378.         set_clipping 201 115    201 115
  379.         ;;
  380. *)        error "Unimplemented paper code $PAPER";;
  381. esac
  382. PAPERSIZE="-sPAPERSIZE=$paper";
  383.  
  384. case "$RES" in
  385. 600x600)    XDIM=`expr $XDIM / 2`;;
  386. 1200x600)    ;;
  387. 2400x600)    XDIM=`expr $XDIM \* 2`;;
  388. esac
  389. DIM="${XDIM}x${YDIM}"
  390.  
  391. #
  392. # If there is an argument left, take it as the file to print.
  393. # Else, the input comes from stdin.
  394. #
  395. if [ $# -ge 1 ]; then
  396.     if [ "$LPJOB" = "" ]; then
  397.     : # LPJOB="$1"
  398.     fi
  399.     exec < $1
  400. fi
  401.  
  402. #
  403. # Filter thru psnup if N-up printing has been requested
  404. #
  405. case $NUP in
  406. [234689]|1[024568])    PREFILTER="nup";;
  407. *)            PREFILTER=cat;;
  408. esac
  409.  
  410. #
  411. #    Overload -G.  If the file name ends with ".icm" or ".ICM"
  412. #    then convert the ICC color profile to a Postscript CRD,
  413. #    then prepend it to the users job.  Select the intent
  414. #    using the -I option.
  415. #
  416.  
  417. create_crd() {
  418.     #
  419.     # Create a Postscript CRD
  420.     #
  421.     ICC2PS=$PREFIX/bin/foo2zjs-icc2ps
  422.     if [ -x $ICC2PS ]; then
  423.     $ICC2PS -o $GAMMAFILE -t$INTENT > $ICCTMP.crd.ps 2>$ICCTMP.log \
  424.     || error "Problem converting .ICM file to Postscript"
  425.     cat > $ICCTMP.usecie.ps <<-EOF
  426.         %!PS-Adobe-3.0
  427.         <</UseCIEColor true>>setpagedevice
  428.     EOF
  429.     cat > $ICCTMP.selcrd.ps <<-EOF
  430.         /Current /ColorRendering findresource setcolorrendering
  431.     EOF
  432.     GAMMAFILE="$ICCTMP.usecie.ps $ICCTMP.crd.ps $ICCTMP.selcrd.ps"
  433.     else
  434.     GAMMFILE=
  435.     fi
  436. }
  437.  
  438. if [ $DEBUG -gt 0 ]; then
  439.     ICCTMP=/tmp/icc
  440. else
  441.     ICCTMP=/tmp/icc$$
  442. fi
  443.  
  444. if [ "" = "$COLOR" ]; then
  445.     COLORMODE=
  446.     GAMMAFILE=
  447. else
  448.     case "$COLORMODE" in
  449.     0)    COLORMODE=$DEFAULTCOLORMODE;;
  450.     esac
  451. fi
  452.  
  453. CRDBASE="$PREFIX/share/foo2zjs/crd"
  454. case "$RES" in
  455.     600x600)    COLORMODE=;;
  456.     1200x600)    SCREEN=screen1200.ps;;
  457.     2400x600)    SCREEN=screen2400.ps;;
  458. esac
  459.  
  460. case "$COLORMODE" in
  461. "")
  462.     # Monochrome
  463.     ;;
  464. 10|icm)
  465.     # Use old ICM method
  466.     AIB=-A
  467.     BC=-B
  468.     case "$GAMMAFILE" in
  469.     *.icm|*.ICM|*.icc|*.ICC)
  470.     #
  471.     # Its really an .ICM file, not a gamma file.
  472.     #
  473.     # The file can be a full path name, or the name of a file in $SHARE/icm/
  474.     #
  475.     if [ -r "$GAMMAFILE" ]; then
  476.         create_crd
  477.     elif [ -r "$SHARE/icm/$GAMMAFILE" ]; then
  478.         GAMMAFILE="$SHARE/icm/$GAMMAFILE"
  479.         create_crd
  480.     else
  481.         GAMMAFILE=
  482.     fi
  483.     ;;
  484.     none)
  485.     GAMMAFILE=
  486.     ;;
  487.     esac
  488.     ;;
  489. 1|photo)
  490.     # Photo
  491.     GAMMAFILE="$CRDBASE/prolog.ps"
  492.     GAMMAFILE="$GAMMAFILE $CRDBASE/2300w-1200@150-l250-kx,ucr125,75-per.crd"
  493.     GAMMAFILE="$GAMMAFILE $CRDBASE/$SCREEN"
  494.     ;;
  495. 2|graphics)
  496.     # Photo and Text
  497.     GAMMAFILE="$CRDBASE/prolog.ps"
  498.     #GAMMAFILE="$GAMMAFILE $CRDBASE/2300w-1200@150-l250-kx,ucr100,75-per.crd"
  499.     GAMMAFILE="$GAMMAFILE $CRDBASE/kh.crd"
  500.     GAMMAFILE="$GAMMAFILE $CRDBASE/$SCREEN"
  501.     ;;
  502. 3|text)
  503.     # Graphic and Text
  504.     GAMMAFILE="$CRDBASE/prolog.ps"
  505.     #GAMMAFILE="$GAMMAFILE $CRDBASE/2300w-1200@150-l250-kx,ucr100,50-per.crd"
  506.     GAMMAFILE="$GAMMAFILE $CRDBASE/kx.crd"
  507.     GAMMAFILE="$GAMMAFILE $CRDBASE/$SCREEN"
  508.     ;;
  509. 4|tonersave)
  510.     # Reduced toner
  511.     GAMMAFILE="$CRDBASE/prolog.ps"
  512.     GAMMAFILE="$GAMMAFILE $CRDBASE/2300w-1200@150-l250-kx,ucr100,0-per.crd"
  513.     GAMMAFILE="$GAMMAFILE $CRDBASE/$SCREEN"
  514.     ;;
  515. *.crd)
  516.     GAMMAFILE="$CRDBASE/prolog.ps"
  517.     if [ -f $COLORMODE ]; then
  518.     GAMMAFILE="$GAMMAFILE $COLORMODE"
  519.     elif [ -f $CRDBASE/$COLORMODE ]; then
  520.     GAMMAFILE="$GAMMAFILE $CRDBASE/$COLORMODE"
  521.     else
  522.     error "Can't find CRD '$COLORMODE' in . or in $CRDBASE"
  523.     fi
  524.     GAMMAFILE="$GAMMAFILE $CRDBASE/$SCREEN"
  525.     ;;
  526. *)
  527.     error "Unknown color method '$COLORMODE'"
  528.     ;;
  529. esac
  530.  
  531. if [ "" != "$COLOR" ]; then
  532.     if [ "" = "$AIB" -a "" = "$BC" ]; then
  533.     # Faster, but can't handle AllIsBlack or BlackClears
  534.     GSDEV=-sDEVICE=pksmraw
  535.     else
  536.     # Can't handle different size pages
  537.     GSDEV=-sDEVICE=bitcmyk
  538.     fi
  539. fi
  540.  
  541. #
  542. #    Figure out USERNAME
  543. #
  544. if [ "$LPUSER" != "" ]; then
  545.     USER="$LPUSER@$LPHOST"
  546. else
  547.     USER=""
  548. fi
  549.  
  550. #
  551. #    Main Program, just cobble together the pipeline and run it
  552. #
  553. #    The malarky with file descriptors 1 and 3 is to avoid a bug in
  554. #    (some versions?) of Ghostscript where Postscript's stdout gets
  555. #    intermingled with the printer drivers output, resulting in
  556. #    corrupted image data.
  557. #
  558. GS="$GSBIN -q -dBATCH -dSAFER -dQUIET -dNOPAUSE"
  559.  
  560. $PREFILTER \
  561. | ($GS $PAPERSIZE -g$DIM -r$RES $GSDEV $GSOPTS \
  562.     -sOutputFile="|cat 1>&3" $GAMMAFILE - >/dev/null) 3>&1 \
  563. | foo2lava -r$RES -g$DIM -p$PAPER -m$MEDIA -n$COPIES -d$DUPLEX -s$SOURCE \
  564.         -z$MODEL $COLOR $CLIP_UL $CLIP_LR $CLIP_LOG $SAVETONER \
  565.         -J "$LPJOB" -U "$USER" \
  566.         $BC $AIB $COLOR2MONO $NOPLANES $EXTRAPAD -D$DEBUG
  567.  
  568. #
  569. #    Log the command line, for debugging and problem reports
  570. #
  571. if [ -x /usr/bin/logger ]; then
  572.     logger -t "$BASENAME" -p lpr.info -- \
  573.     "$GSBIN $PAPERSIZE -g$DIM -r$RES $GSDEV $GSOPT $GAMAFILE"
  574.     logger -t "$BASENAME" -p lpr.info -- \
  575.     "foo2lava -r$RES -g$DIM -p$PAPER -m$MEDIA \
  576. -n$COPIES -d$DUPLEX -s$SOURCE -z$MODEL $COLOR $CLIP_UL $CLIP_LR $CLIP_LOG \
  577. $SAVETONER $BC $AIB $COLOR2MONO $NOPLANES $EXTRAPAD"
  578. fi
  579.  
  580. #
  581. #    Remove cruft
  582. #
  583. if [ $DEBUG -eq 0 ]; then
  584.     for i in crd.ps log usecie.ps selcrd.ps
  585.     do
  586.     file="$ICCTMP.$i"
  587.     [ -f $file ] && rm -f $file
  588.     done
  589. fi
  590.  
  591. exit 0
  592.