~ubuntu-branches/ubuntu/trusty/brother-cups-wrapper-laser/trusty

« back to all changes in this revision

Viewing changes to scripts/cupswrapperFAX2920-2.0.1

  • Committer: Bazaar Package Importer
  • Author(s): Saïvann Carignan
  • Date: 2008-02-15 10:07:22 UTC
  • Revision ID: james.westby@ubuntu.com-20080215100722-h1byi95bycfch7bw
Tags: upstream-2.0.1-2
Import upstream version 2.0.1-2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh
 
2
#
 
3
# Brother Print filter
 
4
# Copyright (C) 2005 Brother. Industries, Ltd.
 
5
 
 
6
# This program is free software; you can redistribute it and/or modify it
 
7
# under the terms of the GNU General Public License as published by the Free
 
8
# Software Foundation; either version 2 of the License, or (at your option)
 
9
# any later version.
 
10
#
 
11
# This program is distributed in the hope that it will be useful, but WITHOUT
 
12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 
13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 
14
# more details.
 
15
#
 
16
# You should have received a copy of the GNU General Public License along with
 
17
# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
 
18
# Place, Suite 330, Boston, MA  02111-1307  USA
 
19
#
 
20
 
 
21
if [ "$1" = '-e' ]; then
 
22
  lpadmin -x FAX2920
 
23
  rm -f /usr/share/cups/model/FAX2920.ppd
 
24
  rm -f /usr/lib/cups/filter/brlpdwrapperFAX2920
 
25
  rm -f /usr/lib64/cups/filter/brlpdwrapperFAX2920
 
26
  rm -f /usr/local/Brother/cupswrapper/brcupsconfig3
 
27
  if [ -e /etc/init.d/cups ]; then
 
28
    /etc/init.d/cups restart
 
29
  fi
 
30
  if [ -e /etc/init.d/cupsys ]; then
 
31
    /etc/init.d/cupsys restart
 
32
  fi
 
33
  exit 0 
 
34
fi
 
35
if [ "$1" = "-r" ]; then
 
36
  lpadmin -x FAX2920
 
37
  if [ -e /etc/init.d/cups ]; then
 
38
    /etc/init.d/cups restart
 
39
  fi
 
40
  if [ -e /etc/init.d/cupsys ]; then
 
41
    /etc/init.d/cupsys restart
 
42
  fi
 
43
  exit 0 
 
44
fi
 
45
if [ "$1" = "help" ] || [ "$1" = "-h" ]; then
 
46
  echo   'option -h : help'
 
47
  echo   '       -i : install'
 
48
  echo   '       -e : uninstall'
 
49
  echo   '       -r : remove printer'
 
50
  exit 0
 
51
fi
 
52
mkdir -p /usr/local/Brother/filter
 
53
mkdir -p /usr/lib/cups/filter
 
54
 
 
55
if [ -e "/usr/local/Brother/lpd/filterFAX2920" ]; then
 
56
  :
 
57
else
 
58
  echo "ERROR : Brother LPD filter is not installed."
 
59
fi
 
60
rm -f /usr/share/cups/model/FAX2920.ppd
 
61
ppd_file_name=/usr/share/cups/model/FAX2920.ppd
 
62
 
 
63
cat <<ENDOFPPDFILE >$ppd_file_name
 
64
*PPD-Adobe: "4.3"
 
65
*%================================================
 
66
*%      Copyright(C) 2006 Brother Industries, Ltd.
 
67
*%      "Brother FAX2920 for CUPS"
 
68
*%================================================
 
69
 
 
70
*%==== General Information Keywords ========================
 
71
*FormatVersion: "4.3"
 
72
*FileVersion: "1.00"
 
73
*LanguageEncoding: ISOLatin1
 
74
*LanguageVersion: English
 
75
*Manufacturer: "Brother"
 
76
*PCFileName: "FAX2920.PPD"
 
77
*Product: "(Brother FAX2920 series)"
 
78
*cupsVersion:   1.1
 
79
*cupsManualCopies: True
 
80
*cupsModelNumber:       68
 
81
*cupsFilter: "application/vnd.cups-postscript 0 brlpdwrapperFAX2920"
 
82
*PSVersion: "(3010.106) 3"
 
83
*ModelName: "FAX2920"
 
84
*NickName: "Brother FAX2920 for CUPS"
 
85
*ShortNickName: "Brother FAX2920 for CUPS"
 
86
 
 
87
*%==== Basic Device Capabilities =============
 
88
*LanguageLevel: "3"
 
89
*TTRasterizer: Type42
 
90
*ColorDevice: False
 
91
*DefaultColorSpace: Gray
 
92
*FileSystem: True
 
93
*?FileSystem:"
 
94
save 
 
95
        /devname (%disk0%) def 
 
96
        /ret false def 
 
97
        0 1 7{ 
 
98
                devname exch 48 add 5 exch put 
 
99
                devname devstatus { 
 
100
                        0 ne {/ret true def}if 
 
101
                        pop pop pop pop pop pop pop 
 
102
                }if 
 
103
        }for 
 
104
        ret {(True)}{(False)} ifelse = flush 
 
105
restore 
 
106
 
107
*End
 
108
 
 
109
*Throughput: "18"
 
110
*FreeVM: "1700000"
 
111
 
 
112
*%==== Installable Options ===================
 
113
 
 
114
*%==== Media Selection ======================
 
115
 
 
116
*OpenUI *PageSize: PickOne
 
117
*OrderDependency: 30 AnySetup *PageSize
 
118
*DefaultPageSize: A4
 
119
*PageSize Letter/Letter: "                      "
 
120
*PageSize Legal/Legal: "                      "
 
121
*PageSize Executive/Executive: "                      "
 
122
*PageSize A4/A4: "                      "
 
123
*PageSize A5/A5: "                      "
 
124
*PageSize A6/A6: "                      "
 
125
*PageSize Env10/Com-10: "                      "
 
126
*PageSize EnvMonarch/Monarch: "                      "
 
127
*PageSize EnvDL/DL: "                      "
 
128
*PageSize EnvC5/C5: "                      "
 
129
*PageSize EnvISOB5/B5: "                      "
 
130
*PageSize EnvISOB6/B6: "                      "
 
131
*CloseUI: *PageSize
 
132
 
 
133
*OpenUI *PageRegion: PickOne
 
134
*OrderDependency: 40 AnySetup *PageRegion
 
135
*DefaultPageRegion: A4
 
136
*PageRegion Letter/Letter: "                      "
 
137
*PageRegion Legal/Legal: "                      "
 
138
*PageRegion Executive/Executive: "                      "
 
139
*PageRegion A4/A4: "                      "
 
140
*PageRegion A5/A5: "                      "
 
141
*PageRegion A6/A6: "                      "
 
142
*PageRegion Env10/Com-10: "                      "
 
143
*PageRegion EnvMonarch/Monarch: "                      "
 
144
*PageRegion EnvDL/DL: "                      "
 
145
*PageRegion EnvC5/C5: "                      "
 
146
*PageRegion EnvISOB5/B5: "                      "
 
147
*PageRegion EnvISOB6/B6: "                      "
 
148
*CloseUI: *PageRegion
 
149
 
 
150
*DefaultImageableArea: A4
 
151
*ImageableArea Letter/Letter: "18 12 594 780"
 
152
*ImageableArea Legal/Legal: "18 12 594 996"
 
153
*ImageableArea Executive/Executive: "18 12 504 744"
 
154
*ImageableArea A4/A4: "18 12 577 830"
 
155
*ImageableArea A5/A5: "18 12 403 583"
 
156
*ImageableArea A6/A6: "18 12 279 408"
 
157
*ImageableArea Env10/Com-10: "18 12 279 672"
 
158
*ImageableArea EnvMonarch/Monarch: "18 12 261 528"
 
159
*ImageableArea EnvDL/DL: "18 12 294 612"
 
160
*ImageableArea EnvC5/C5: "18 12 441 637"
 
161
*ImageableArea EnvISOB5/B5: "18 12 463 697"
 
162
*ImageableArea EnvISOB6/B6: "18 12 336 487"
 
163
 
 
164
*%==== Information About Media Sizes ========
 
165
 
 
166
*DefaultPaperDimension: A4
 
167
*PaperDimension Letter/Letter: "612 792"
 
168
*PaperDimension Legal/Legal: "612 1008"
 
169
*PaperDimension Executive/Executive: "522 756"
 
170
*PaperDimension A4/A4: "595 842"
 
171
*PaperDimension A5/A5: "420 595"
 
172
*PaperDimension A6/A6: "297 420"
 
173
*PaperDimension Env10/Com-10: "297 684"
 
174
*PaperDimension EnvMonarch/Monarch: "279 540"
 
175
*PaperDimension EnvDL/DL: "312 624"
 
176
*PaperDimension EnvC5/C5: "459 649"
 
177
*PaperDimension EnvISOB5/B5: "499 709"
 
178
*PaperDimension EnvISOB6/B6: "354 499"
 
179
 
 
180
*%==== 5.13 Media Handling Features ============================
 
181
*OpenUI *BrMediaType/BrMediaType: PickOne
 
182
*OrderDependency: 28 AnySetup *BrMediaType
 
183
*DefaultBrMediaType: PLAIN
 
184
*BrMediaType PLAIN/Plain Paper: "                      "
 
185
*BrMediaType THIN/Thin Paper: "                      "
 
186
*BrMediaType THICK/Thick Paper: "                      "
 
187
*BrMediaType THICKERPAPER2/Thicker Paper: "                      "
 
188
*BrMediaType BOND/Bond Paper: "                      "
 
189
*BrMediaType TRANSPARENCIES/Transparencies: "                      "
 
190
*BrMediaType ENV/Envelopes: "                      "
 
191
*BrMediaType ENVTHICK/Env. Thick: "                      "
 
192
*BrMediaType ENVTHIN/Env. Thin: "                      "
 
193
*CloseUI: *BrMediaType
 
194
 
 
195
*OpenUI *InputSlot/InputSlot: PickOne
 
196
*OrderDependency: 29 AnySetup *InputSlot
 
197
*DefaultInputSlot: TRAY1
 
198
*InputSlot MANUAL/Manual Feed: "                      "
 
199
*InputSlot TRAY1/Tray1: "                      "
 
200
*CloseUI: *InputSlot
 
201
 
 
202
*RequiresPageRegion All:True
 
203
 
 
204
 
 
205
*%=== Duplex ================================
 
206
*%=== Output Bin =============================
 
207
*% === Collate ==========
 
208
*%==== 5.14 Finishing Features =================================
 
209
*%%%%% Resolution and Appearance Control %%%%%
 
210
*OpenUI *Resolution: PickOne
 
211
*OrderDependency: 11 AnySetup *Resolution
 
212
*DefaultResolution: 600dpi
 
213
*Resolution     300dpi: "                      "
 
214
*Resolution     600dpi: "                      "
 
215
*Resolution     1200x600dpi/HQ1200dpi: "                    "
 
216
*CloseUI: *Resolution
 
217
 
 
218
*OpenUI *TonerSaveMode/Toner Save: PickOne
 
219
*DefaultTonerSaveMode: Off
 
220
*OrderDependency: 10 AnySetup  *TonerSaveMode
 
221
*TonerSaveMode Off/Off: "statusdict begin false tonersave end"
 
222
*TonerSaveMode On/On: "statusdict begin true tonersave end"
 
223
*CloseUI: *TonerSaveMode
 
224
 
 
225
*OpenUI *Sleep/Sleep Time [Min.]: PickOne
 
226
*DefaultSleep: PrinterDefault
 
227
*OrderDependency: 10 AnySetup  *Sleep
 
228
*Sleep PrinterDefault/Printer Default: ""
 
229
*Sleep 2minutes/2: "statusdict begin 2 powersavetime end"
 
230
*Sleep 10minutes/10: "statusdict begin 10 powersavetime end"
 
231
*Sleep 30minutes/30: "statusdict begin 30 powersavetime end"
 
232
*CloseUI: *Sleep
 
233
 
 
234
*%==== 5.20 Font Related Keywords ==============================
 
235
*DefaultFont: Courier
 
236
*Font AvantGarde-Book: Standard "(001.006S)" Standard ROM
 
237
*Font AvantGarde-BookOblique: Standard "(001.006S)" Standard ROM
 
238
*Font AvantGarde-Demi: Standard "(001.007S)" Standard ROM
 
239
*Font AvantGarde-DemiOblique: Standard "(001.007S)" Standard ROM
 
240
*Font Bookman-Demi: Standard "(001.004S)" Standard ROM
 
241
*Font Bookman-DemiItalic: Standard "(001.004S)" Standard ROM
 
242
*Font Bookman-Light: Standard "(001.004S)" Standard ROM
 
243
*Font Bookman-LightItalic: Standard "(001.004S)" Standard ROM
 
244
*Font Courier: Standard "(002.004S)" Standard ROM
 
245
*Font Courier-Bold: Standard "(002.004S)" Standard ROM
 
246
*Font Courier-BoldOblique: Standard "(002.004S)" Standard ROM
 
247
*Font Courier-Oblique: Standard "(002.004S)" Standard ROM
 
248
*Font Helvetica: Standard "(001.006S)" Standard ROM
 
249
*Font Helvetica-Bold: Standard "(001.007S)" Standard ROM
 
250
*Font Helvetica-BoldOblique: Standard "(001.007S)" Standard ROM
 
251
*Font Helvetica-Narrow: Standard "(001.006S)" Standard ROM
 
252
*Font Helvetica-Narrow-Bold: Standard "(001.007S)" Standard ROM
 
253
*Font Helvetica-Narrow-BoldOblique: Standard "(001.007S)" Standard ROM
 
254
*Font Helvetica-Narrow-Oblique: Standard "(001.006S)" Standard ROM
 
255
*Font Helvetica-Oblique: Standard "(001.006S)" Standard ROM
 
256
*Font NewCenturySchlbk-Bold: Standard "(001.009S)" Standard ROM
 
257
*Font NewCenturySchlbk-BoldItalic: Standard "(001.007S)" Standard ROM
 
258
*Font NewCenturySchlbk-Italic: Standard "(001.006S)" Standard ROM
 
259
*Font NewCenturySchlbk-Roman: Standard "(001.007S)" Standard ROM
 
260
*Font Palatino-Bold: Standard "(001.005S)" Standard ROM
 
261
*Font Palatino-BoldItalic: Standard "(001.005S)" Standard ROM
 
262
*Font Palatino-Italic: Standard "(001.005S)" Standard ROM
 
263
*Font Palatino-Roman: Standard "(001.005S)" Standard ROM
 
264
*Font Times-Bold: Standard "(001.007S)" Standard ROM
 
265
*Font Times-BoldItalic: Standard "(001.009S)" Standard ROM
 
266
*Font Times-Italic: Standard "(001.007S)" Standard ROM
 
267
*Font Times-Roman: Standard "(001.007S)" Standard ROM
 
268
*Font ZapfChancery-MediumItalic: Standard "(001.007S)" Standard ROM
 
269
*Font ZapfDingbats: Special "(001.004S)" Special ROM
 
270
*Font Symbol: Special "(001.007S)" Special ROM
 
271
*Font Alaska: Standard "(001.005)" Standard ROM
 
272
*Font AlaskaExtrabold: Standard "(001.005)" Standard ROM
 
273
*Font AntiqueOakland: Standard "(001.005)" Standard ROM
 
274
*Font AntiqueOakland-Bold: Standard "(001.005)" Standard ROM
 
275
*Font AntiqueOakland-Oblique: Standard "(001.005)" Standard ROM
 
276
*Font ClevelandCondensed: Standard "(001.005)" Standard ROM
 
277
*Font Connecticut: Standard "(001.005)" Standard ROM
 
278
*Font Guatemala-Antique: Standard "(001.005)" Standard ROM
 
279
*Font Guatemala-Bold: Standard "(001.005)" Standard ROM
 
280
*Font Guatemala-Italic: Standard "(001.005)" Standard ROM
 
281
*Font Guatemala-BoldItalic: Standard "(001.005)" Standard ROM
 
282
*Font LetterGothic: Standard "(001.005)" Standard ROM
 
283
*Font LetterGothic-Bold: Standard "(001.005)" Standard ROM
 
284
*Font LetterGothic-Oblique: Standard "(001.005)" Standard ROM
 
285
*Font Maryland: Standard "(001.005)" Standard ROM
 
286
*Font Oklahoma: Standard "(001.005)" Standard ROM
 
287
*Font Oklahoma-Bold: Standard "(001.005)" Standard ROM
 
288
*Font Oklahoma-Oblique: Standard "(001.005)" Standard ROM
 
289
*Font Oklahoma-BoldOblique: Standard "(001.005)" Standard ROM
 
290
*Font Utah: Standard "(001.005)" Standard ROM
 
291
*Font Utah-Bold: Standard "(001.005)" Standard ROM
 
292
*Font Utah-Oblique: Standard "(001.005)" Standard ROM
 
293
*Font Utah-BoldOblique: Standard "(001.005)" Standard ROM
 
294
*Font UtahCondensed: Standard "(001.005)" Standard ROM
 
295
*Font UtahCondensed-Bold: Standard "(001.005)" Standard ROM
 
296
*Font UtahCondensed-Oblique: Standard "(001.004)" Standard ROM
 
297
*Font UtahCondensed-BoldOblique: Standard "(001.005)" Standard ROM
 
298
*Font BermudaScript: Standard "(001.005)" Standard ROM
 
299
*Font Germany: Standard "(001.005)" Standard ROM
 
300
*Font SanDiego: Standard "(001.005)" Standard ROM
 
301
*Font US-Roman: Standard "(001.005)" Standard ROM
 
302
*?FontQuery: "
 
303
save
 
304
count 1 gt
 
305
  {exch dup dup
 
306
   =string cvs (/) print print (:) print
 
307
   FontDirectory exch known
 
308
     {pop(Yes)}
 
309
     {(fonts/)AppendName exch pop mark exch
 
310
      {}=string filenameforall counttomark
 
311
      0 gt
 
312
        {cleartomark(Yes)}
 
313
        {cleartomark(No)}ifelse
 
314
     }ifelse
 
315
   =
 
316
  }if
 
317
  (*) = flush
 
318
restore
 
319
"
 
320
*End
 
321
*?FontList: "
 
322
save
 
323
  FontDirectory{pop ==}forall
 
324
  (fonts/*)
 
325
  {dup length 6 sub 6 exch getinterval cvn ==
 
326
  }=string filenameforall
 
327
  (*) = flush
 
328
restore
 
329
"
 
330
*End
 
331
 
 
332
 
 
333
ENDOFPPDFILE
 
334
 
 
335
 
 
336
brotherlpdwrapper=/usr/lib/cups/filter/brlpdwrapperFAX2920
 
337
brotherlpdwrapper64=/usr/lib64/cups/filter/brlpdwrapperFAX2920
 
338
rm -f  $brotherlpdwrapper
 
339
 
 
340
 
 
341
cat <<!ENDOFWFILTER! >$brotherlpdwrapper
 
342
#! /bin/sh
 
343
#
 
344
# Brother Print filter  >>  $brotherlpdwrapper
 
345
# Copyright (C) 2005 Brother. Industries, Ltd.
 
346
#                                    Ver1.00
 
347
 
 
348
# This program is free software; you can redistribute it and/or modify it
 
349
# under the terms of the GNU General Public License as published by the Free
 
350
# Software Foundation; either version 2 of the License, or (at your option)
 
351
# any later version.
 
352
#
 
353
# This program is distributed in the hope that it will be useful, but WITHOUT
 
354
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 
355
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 
356
# more details.
 
357
#
 
358
# You should have received a copy of the GNU General Public License along with
 
359
# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
 
360
# Place, Suite 330, Boston, MA  02111-1307  USA
 
361
#
 
362
LOGFILE="/dev/null"
 
363
LOGCLEVEL="7"
 
364
DEBUG=0
 
365
NUPENABLE=1
 
366
ENABLECOPY=0
 
367
LOG_LATESTONLY=1
 
368
errorcode=0
 
369
 
 
370
set +o noclobber
 
371
if [ "\`echo \$5 | grep 'debug-noprint=1'\`" != '' ]; then
 
372
    DEBUG=1
 
373
fi
 
374
if [ "\`echo \$5 | grep 'debug-noprint=2'\`" != '' ]; then
 
375
    DEBUG=2
 
376
fi
 
377
if [ "\`echo \$5 | grep 'debug-noprint=3'\`" != '' ]; then
 
378
    DEBUG=3
 
379
fi
 
380
if [ \$DEBUG != 0 ]; then
 
381
    LOGFILE=/tmp/br_cupsfilter_debug_log
 
382
fi
 
383
 
 
384
PRINTER=FAX2920
 
385
 
 
386
 
 
387
if [ "\$PPD" = "" ]; then
 
388
    PPD="/usr/share/cups/model/FAX2920.ppd"
 
389
fi
 
390
 
 
391
 
 
392
if [ \$LOGFILE != "/dev/null" ]; then
 
393
  if [ \$LOG_LATESTONLY == "1" ]; then
 
394
    rm -f \$LOGFILE
 
395
    date                                                           >\$LOGFILE
 
396
  else
 
397
    if [ -e \$LOGFILE ]; then
 
398
            date                                                        >>\$LOGFILE
 
399
    else
 
400
            date                                                        >\$LOGFILE
 
401
    fi
 
402
  fi
 
403
    echo "arg0 = \$0"                                           >>\$LOGFILE
 
404
    echo "arg1 = \$1"                                           >>\$LOGFILE
 
405
    echo "arg2 = \$2"                                           >>\$LOGFILE
 
406
    echo "arg3 = \$3"                                           >>\$LOGFILE
 
407
    echo "arg4 = \$4"                                           >>\$LOGFILE
 
408
    echo "arg5 = \$5"                                           >>\$LOGFILE
 
409
    echo "arg6 = \$6"                                           >>\$LOGFILE
 
410
    echo "PPD  = \$PPD"                                         >>\$LOGFILE
 
411
fi
 
412
 
 
413
INPUT_TEMP_PS=\`mktemp /tmp/br_input_ps.XXXXXX\`
 
414
 
 
415
nup="cat"
 
416
if [ "\`echo \$5 | grep 'Nup='\`" != '' ] && [ \$NUPENABLE != 0 ]; then
 
417
 
 
418
        if   [ "\`echo \$5 | grep 'Nup=64'\`" != '' ]; then
 
419
                nup="psnup -64"
 
420
        elif [ "\`echo \$5 | grep 'Nup=32'\`" != '' ]; then
 
421
                nup="psnup -32"
 
422
        elif [ "\`echo \$5 | grep 'Nup=25'\`" != '' ]; then
 
423
                nup="psnup -25"
 
424
        elif [ "\`echo \$5 | grep 'Nup=16'\`" != '' ]; then
 
425
                nup="psnup -16"
 
426
        elif [ "\`echo \$5 | grep 'Nup=8'\`" != '' ]; then
 
427
                nup="psnup -8"
 
428
        elif [ "\`echo \$5 | grep 'Nup=6'\`" != '' ]; then
 
429
                nup="psnup -6"
 
430
        elif [ "\`echo \$5 | grep 'Nup=4'\`" != '' ]; then
 
431
                nup="psnup -4"
 
432
        elif [ "\`echo \$5 | grep 'Nup=2'\`" != '' ]; then
 
433
                nup="psnup -2"
 
434
        elif [ "\`echo \$5 | grep 'Nup=1'\`" != '' ]; then
 
435
                nup="cat"
 
436
        fi
 
437
        echo   "NUP=\$nup"                                      >>\$LOGFILE
 
438
   if [ -e /usr/bin/psnup ]; then
 
439
       if [ \$# -ge 7 ]; then
 
440
               cat \$6  | \$nup > \$INPUT_TEMP_PS
 
441
       else
 
442
               cat       | \$nup > \$INPUT_TEMP_PS
 
443
       fi
 
444
   else
 
445
       if [ \$# -ge 7 ]; then
 
446
               cp \$6  \$INPUT_TEMP_PS
 
447
       else
 
448
               cat    > \$INPUT_TEMP_PS
 
449
       fi
 
450
   fi
 
451
else
 
452
   if [ \$# -ge 7 ]; then
 
453
      cp \$6  \$INPUT_TEMP_PS
 
454
   else
 
455
      cat    > \$INPUT_TEMP_PS
 
456
   fi
 
457
fi
 
458
 
 
459
if [ "\$ENABLECOPY" != 0 ];then
 
460
  if [ "\$4" -ge 2 ];then
 
461
     options="\$5"" ""Copies=\$4"
 
462
  else
 
463
     options="\$5"
 
464
  fi
 
465
else
 
466
  options="\$5"
 
467
fi
 
468
 
 
469
 
 
470
if [ -e "/usr/local/Brother/lpd/filter\$PRINTER" ]; then
 
471
       :
 
472
else
 
473
    echo "ERROR: /usr/local/Brother/lpd/filter\$PRINTER does not exist"   >>\$LOGFILE
 
474
    errorcode=30
 
475
    exit $errorcode
 
476
fi
 
477
 
 
478
if [ -e "/usr/local/Brother/cupswrapper/brcupsconfig3" ]; then
 
479
  if [ \$DEBUG = 0 ]; then
 
480
     /usr/local/Brother/cupswrapper/brcupsconfig3  \$PRINTER  \$PPD 0 "\$options" >> /dev/null
 
481
  else
 
482
     /usr/local/Brother/cupswrapper/brcupsconfig3  \$PRINTER  \$PPD \$LOGCLEVEL "\$options" >>\$LOGFILE
 
483
  fi
 
484
fi
 
485
 
 
486
 
 
487
if [ \$DEBUG -le 2 ]; then
 
488
    cat    \$INPUT_TEMP_PS | /usr/local/Brother/lpd/filter\$PRINTER
 
489
fi
 
490
 
 
491
if [ \$DEBUG -ge 2 ];  then
 
492
           if [ \$LOGFILE != "/dev/null" ]; then
 
493
             echo ""                                                >>\$LOGFILE
 
494
             echo "    ------PostScript Data-------"                >>\$LOGFILE
 
495
             cat    \$INPUT_TEMP_PS                                  >>\$LOGFILE
 
496
           fi
 
497
fi
 
498
rm -f  \$INPUT_TEMP_PS
 
499
 
 
500
exit \$errorcode
 
501
 
 
502
!ENDOFWFILTER!
 
503
 
 
504
 
 
505
chmod a+x $brotherlpdwrapper
 
506
if [ -e /usr/lib64/cups/filter ]; then
 
507
   cp $brotherlpdwrapper  $brotherlpdwrapper64
 
508
fi
 
509
 
 
510
chmod a+w /usr/local/Brother/inf/brFAX2920rc
 
511
chmod a+w /usr/local/Brother/inf
 
512
if [ -e /etc/init.d/lpd ]; then
 
513
   /etc/init.d/lpd stop
 
514
fi
 
515
if [  -e /etc/init.d/lprng ]; then
 
516
   /etc/init.d/lprng stop
 
517
fi
 
518
  if [ -e /etc/init.d/cups ]; then
 
519
    /etc/init.d/cups restart
 
520
  fi
 
521
  if [ -e /etc/init.d/cupsys ]; then
 
522
    /etc/init.d/cupsys restart
 
523
  fi
 
524
sleep 2s
 
525
port2=`lpinfo -v | grep -i 'usb://Brother/FAX-2920' | head -1`
 
526
if [ "$port2" = '' ];then
 
527
        port2=`lpinfo -v | grep 'usb://' | head -1`
 
528
fi
 
529
port=`echo $port2| sed s/direct//g`
 
530
if [ "$port" = '' ];then
 
531
        port=usb:/dev/usb/lp0
 
532
fi
 
533
lpadmin -p FAX2920 -E -v $port -P /usr/share/cups/model/FAX2920.ppd
 
534
  exit 0