linux-brprinter-installer-2.2.1-1 140 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094
  1. #! /bin/bash
  2. #
  3. # Copyright(c) 2011-2018 Brother Industries, Ltd.
  4. # All Rights Reserved.
  5. #
  6. #Brother retains any and all copyrights to the Software.
  7. #In no case this Agreement shall be construed to assign
  8. #or otherwise transfer from Brother to User any copyrights
  9. #or other intellectual property rights to whole or any part
  10. #of the Software.
  11. #
  12. #Brother grants User a non-exclusive license: to reproduce
  13. #and/or distribute (via Internet or in any other manner) the
  14. #Software. Further, Brother grants User a non-exclusive
  15. #license to modify, alter, translate or otherwise prepare
  16. #derivative works of the Software and to reproduce and
  17. #distribute (via Internet or in any other manner) such
  18. #modification, alteration, translation or other derivative
  19. #works for any purpose.
  20. #
  21. #The license of the Software from Brother hereunder is
  22. #granted "AS IS." BROTHER HEREBY DISCLAIMS ANY WARRANTIES WITH
  23. # RESPECT TO THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING
  24. #BUT NOT LIMITED TO WARRANTY FOR THE QUALITY, MERCHANTABILITY,
  25. #FITNESS FOR PARTICULAR PURPOSE OR NON-INFRINGEMENT.
  26. #Brother shall have no liability in contract, tort (including
  27. #negligence or breach of statutory duty) or otherwise for any
  28. #interruption of use, loss of data, or for any indirect,
  29. #incidental, punitive or consequential loss or damage, or for
  30. #any loss of profit, revenue, data, goodwill or anticipated
  31. #savings that arises under, out of, or in contemplation of
  32. #this Agreement or otherwise arises due to any error, inaccuracy
  33. #or defect in the Software even if Brother has been advised of
  34. #the possibility of such loss or damage.
  35. #Further, Brother shall have no liability to disclose and/or
  36. #distribute the source cord of the Software to User under any
  37. #circumstances. In no case shall the above license by Brother
  38. #to modify, alter, translate or otherwise prepare derivative
  39. #works of the Software be construed as Brother's implied
  40. #agreement or undertakings to disclose and/or distribute the
  41. #source cord of the Software.
  42. DEBUG_MSG=0
  43. MSG=1
  44. COLOR='\033[1;31m'
  45. COLOR2='\033[1;35m'
  46. COLOR3='\033[1;32m'
  47. COLOR4='\033[1;34m'
  48. MONO='\033[1;0m'
  49. if [ "$(echo $0 | grep linux-brjprinter-installer)" = '' ];then
  50. MESSAGE010="USAGE: "
  51. MESSAGE012=" : "
  52. MESSAGE020=" model"
  53. MESSAGE030=" -f model"
  54. MESSAGE040=" -l "
  55. MESSAGE050="Only root can perform this operation."
  56. MESSAGE060="CUPS is not installed."
  57. MESSAGE070="Do you want to specify a PROXY server? [y/N] ->"
  58. MESSAGE080="Enter the URL of the PROXY server."
  59. MESSAGE090=" ex http://(proxy-server-url):(port)"
  60. MESSAGE100=" ex http://(login-name):(password)@(proxy-server-url):(port)"
  61. MESSAGE110=" ->"
  62. MESSAGE120="Unable to get the server information."\
  63. " Please check the network settings."
  64. MESSAGE121="Input model name ->"
  65. MESSAGE122="Rpm or dpkg is required."
  66. MESSAGE130="Driver-packages cannot be found."
  67. MESSAGE140=" Confirm the model name."
  68. MESSAGE150="You are going to install following packages."
  69. MESSAGE160="OK? [y/N] ->"
  70. MESSAGE165="OK? [Y/n] ->"
  71. MESSAGE170="Do you agree? [Y/n] ->"
  72. MESSAGE180="Do you agree? [Y/n] ->"
  73. MESSAGE182="The security level of SELinux has been temporarily lowered "\
  74. "to enable the test print."\
  75. " To set it permanently, modify the SELinux configuration file."
  76. MESSAGE184="The security level of AppArmor has been lowered."\
  77. " (aa-complain cups)"
  78. MESSAGE190="Will you specify the Device URI? [Y/n] ->"
  79. MESSAGE200="Specify IP address."
  80. MESSAGE201="Auto."
  81. MESSAGE210="select the number of destination Device URI. ->"
  82. MESSAGE220=" enter IP address ->"
  83. MESSAGE230="Test Print? [y/N] ->"
  84. MESSAGE240="Hit Enter/Return key."
  85. MESSAGE250="csh/tcsh is required"
  86. MESSAGE260="The security level of SELinux has been lowered."\
  87. " (semanage permissive -a cupsd_t)"
  88. MESSAGE270="glibc.i686/libstdc++ is requored."\
  89. MESSAGE280="wget is required."
  90. else
  91. MESSAGE010="使用方法: "
  92. MESSAGE012="    : "
  93. MESSAGE020=" モデル名"
  94. MESSAGE030=" -f モデル名"
  95. MESSAGE040=" -l "
  96. MESSAGE050="権限がありません。suもしくはsudoコマンドでroot権限を取得してください。"
  97. MESSAGE060="CUPSがインストールされていません。"
  98. MESSAGE070="WEBより情報を取得できません。PROXYサーバーを指定しますか? [y/N] ->"
  99. MESSAGE080="PROXYサーバーのURLを入力してください。"
  100. MESSAGE090=" 例1 http://(proxy-server-url):(port)"
  101. MESSAGE100=" 例2 http://(login-name):(pass-word)@(proxy-server-url):(port)"
  102. MESSAGE110=" ->"
  103. MESSAGE120="インターネットに接続できません。ネットワーク設定を確認してください。"
  104. MESSAGE121="モデル名を入力してください。->"
  105. MESSAGE122="rpmもしくはdpkgが必要です。"
  106. MESSAGE130="該当するドライバパッケージが見つかりません。"
  107. MESSAGE140="  モデル名を確認してください。"
  108. MESSAGE150="以下のパッケージが見付かりました。"
  109. MESSAGE160="インストールしますか? [y/N] ->"
  110. MESSAGE165="インストールしますか? [Y/n] ->"
  111. MESSAGE170="上記使用許諾に同意しますか? [Y/n] ->"
  112. MESSAGE180="上記使用許諾に同意しますか? [Y/n] ->"
  113. MESSAGE182="一時的にSELinuxのセキュリティレベルを下げました。恒久対策としてCUPSのセキュリティレベルをpermissiveにしてください。"
  114. MESSAGE184="AppArmorのCUPSに対するセキュリティレベルを下げました (aa-complain cups)。"
  115. MESSAGE190="Device URIを指定しますか? [Y/n] ->"
  116. MESSAGE200="IPアドレスの指定"
  117. MESSAGE201="自動設定"
  118. MESSAGE210="使用するDevice URIの番号を選択してください。 ->"
  119. MESSAGE220=" ご使用のプリンタ/MFCのIPアドレスを指定してください。->"
  120. MESSAGE230="テスト印刷を実行しますか? [y/N] ->"
  121. MESSAGE240="Enterキーを押してください。"
  122. MESSAGE250="csh/tcsh が必要です。"
  123. MESSAGE260="SELinuxのCUPSに対するセキュリティレベルを下げました。"\
  124. " (semanage permissive -a cupsd_t)"
  125. MESSAGE270="32bitライブラリ(glibc.i686/libstdc++)が必要です 。"\
  126. MESSAGE280="'wget'が必要です。"
  127. fi
  128. if [ -e "$0".rc ];then
  129. source "$0".rc
  130. fi
  131. brother_license(){
  132. echo -e $COLOR2
  133. if [ $REGION != JPN ];then
  134. cat <<BROTHERLICENSE
  135. =========================================
  136. Brother License Agreement
  137. Brother retains any and all copyrights to the Software. In no case this Agreement shall be construed to assign or otherwise transfer from Brother to User any copyrights or other intellectual property rights to whole or any part of the Software.
  138. Brother grants User a non-exclusive license: to reproduce and/or distribute (via Internet or in any other manner) the Software. Further, Brother grants User a non-exclusive license to modify, alter, translate or otherwise prepare derivative works of the Software and to reproduce and distribute (via Internet or in any other manner) such modification, alteration, translation or other derivative works for any purpose.
  139. The license of the Software from Brother hereunder is granted "AS IS." BROTHER HEREBY DISCLAIMS ANY WARRANTIES WITH RESPECT TO THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTY FOR THE QUALITY, MERCHANTABILITY, FITNESS FOR PARTICULAR PURPOSE OR NON-INFRINGEMENT.
  140. Brother shall have no liability in contract, tort (including negligence or breach of statutory duty) or otherwise for any interruption of use, loss of data, or for any indirect, incidental, punitive or consequential loss or damage, or for any loss of profit, revenue, data, goodwill or anticipated savings that arises under, out of, or in contemplation of this Agreement or otherwise arises due to any error, inaccuracy or defect in the Software even if Brother has been advised of the possibility of such loss or damage.
  141. Further, Brother shall have no liability to disclose and/or distribute the source cord of the Software to User under any circumstances. In no case shall the above license by Brother to modify, alter, translate or otherwise prepare derivative works of the Software be construed as Brother's implied agreement or undertakings to disclose and/or distribute the source cord of the Software.
  142. =========================================
  143. BROTHERLICENSE
  144. else
  145. cat <<BROTHERLICENSEJ
  146. =========================================
  147. ブラザーソフトウェア用 公衆使用許諾契約書
  148. 本契約は、本契約とともに配布・提供されるソフトウェア (以下単に本ソフトウェアといいます) に関し、本ソフトウェアの著作権者であるブラザー工業株式会社 (以下、ブラザーといいます) から本ソフトウェア受領者 (以下単に利用者といいます) に対し与えられる使用許諾について定めるものです。 利用者は、下記条項に従い本ソフトウェアを利用するものとします。 また、利用者は本ソフトウェアを利用することにより、下記条項に同意したものと見なされます。
  149. (1)本ソフトウェアに関する著作権は、ブラザーに帰属します。 本契約は、本ソフトウェアについてブラザーから利用者に対し著作権の全部若しくは一部を譲渡するものとは解され得ません。
  150. (2)ブラザーは利用者に対し、本ソフトウェアについて複製、譲渡 (著作権の譲渡ではなくソフトウェアが格納された媒体の譲渡を指します) および公衆送信を行う権利を無償にて非独占的に許諾します。
  151. (3)さらにブラザーは利用者に対し、いかなる目的のためにでも本ソフトウェアを変更、改変、翻訳あるいは本ソフトウェアの派生物を作成し、かつそれらについて複製、譲渡及び公衆送信を行う権利を無償にて非独占的に許諾します。
  152. (4)ブラザーによる本ソフトウェアの配布・提供は、現状有姿にて行われるものであり、ブラザーは利用者に対し、本ソフトウェアに関し、明示・黙示問わず、何らの保証 (品質保証・有用性に関する保証・特定目的への合致に関する保証その他一切含め) も行いません。
  153. (5)ブラザーは本ソフトウェアに関し、利用者に生じたいかなる損害 (直接損害・間接損害・特別損害・派生損害・懲罰的損害その他一切含め) についても、かかる損害が予測可能か否か、また、その可能性についてブラザーが知っていたか否かを問わず、賠償義務を負いません。
  154. (6)さらにブラザーは利用者に対し、いかなる場合も本ソフトウェアのソースコードを開示する義務を負いません。 上記ブラザーによる変更、改変、翻訳あるいは本ソフトウェアの派生物作成に関するライセンスは、いかなる場合にも、本ソフトウェアのソースコード開示に関するブラザーの黙示的な同意とは解釈されません。
  155. =========================================
  156. BROTHERLICENSEJ
  157. echo -e $MONO
  158. fi
  159. }
  160. gpl_license(){
  161. echo -e $COLOR2
  162. cat <<GPLLICENSE
  163. =========================================
  164. GPL License Agreement
  165. This Software may be used in accordance with GNU General Public License (GPL). Please read carefully the following GPL and click on "I Accept" button. If you cannot agree with the following terms, please click "I don't Accept" button. In case of your non-acceptance, you can not use this Software.
  166. Note:
  167. Please click on "I Accept" while holding down "Shift" or right click on "I Accept" and select "Save Target As,,," from the menu.
  168. GNU GENERAL PUBLIC LICENSE
  169. Version 2, June 1991
  170. Copyright (C) 1989, 1991 Free Software Foundation, Inc.51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  171. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
  172. Preamble
  173. The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by
  174. the GNU Library General Public License instead.) You can apply it to your programs, too.
  175. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.
  176. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.
  177. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the
  178. source code. And you must show them these terms so they know their rights.
  179. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.
  180. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations.
  181. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.
  182. The precise terms and conditions for copying, distribution and modification follow.
  183. GNU GENERAL PUBLIC LICENSE
  184. TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
  185. 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you".
  186. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program
  187. is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.
  188. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.
  189. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
  190. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
  191. a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.
  192. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.
  193. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an
  194. announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)
  195. These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
  196. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.
  197. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
  198. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:
  199. a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
  200. b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
  201. c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you
  202. received the program in object code or executable form with such an offer, in accord with Subsection b above.)
  203. The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
  204. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.
  205. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
  206. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying
  207. the Program or works based on it.
  208. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.
  209. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.
  210. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.
  211. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
  212. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
  213. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
  214. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
  215. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.
  216. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
  217. NO WARRANTY
  218. 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
  219. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
  220. END OF TERMS AND CONDITIONS
  221. How to Apply These Terms to Your New Programs
  222. If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
  223. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
  224. <one line to give the program's name and a brief idea of what it does.>
  225. Copyright (C) <year> <name of author>
  226. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
  227. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  228. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  229. Also add information on how to contact you by electronic and paper mail.
  230. If the program is interactive, make it output a short notice like this when it starts in an interactive mode:
  231. Gnomovision version 69, Copyright (C) year name of author Gnomovision
  232. comes with ABSOLUTELY NO WARRANTY; for details type \`show w'.
  233. This is free software, and you are welcome to redistribute it
  234. under certain conditions; type \`show c' for details.
  235. The hypothetical commands \`show w' and \`show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than \`show w' and \`show c'; they could even be mouse-clicks or menu items--whatever suits your program.
  236. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names:
  237. Yoyodyne, Inc., hereby disclaims all copyright interest in the program
  238. \`Gnomovision' (which makes passes at compilers) written by James Hacker.
  239. <signature of Ty Coon>, 1 April 1989
  240. Ty Coon, President of Vice
  241. This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License.
  242. =========================================
  243. GPLLICENSE
  244. echo -e $MONO
  245. }
  246. gpl_and_br_license(){
  247. echo -e $COLOR2
  248. if [ $REGION = JPN ];then
  249. cat <<GPLBROTHERLICENSE_J
  250. 本契約は、本契約とともに配布・提供されるソフトウェア(以下単に本ソフトウェアといいます)に関し、ブラザー工業株式会社(以下、ブラザーといいます)から本ソフトウェア受領者(以下、お客様といいます)に対し与えられる使用許諾について定めるものです。
  251. 1.本ソフトウェアは、以下のモジュールから構成されています。
  252. (1) GNU GENERAL PUBLIC LICENSE対象ソフトウェアモジュール(以下、GPL対象モジュールといいます)
  253. (2) 上記に該当しないソフトウェアモジュール(以下、非GPLモジュールといいます。
  254. 本ソフトウェアを構成する各モジュールが上記のいずれに該当するかについては、本ソフトウェアのソースファイルをダウンロード頂きご確認ください。
  255. 2.GPL対象モジュールについては、GNU GENERAL PUBLIC LICENSE Version 2, June 1991(以下GPLv2といいます)の条件が適用されます。その条件の詳細については、 http://www.brother.co.jp/jp/agreement/japanese_gpl/agree.html をご確認ください。GPL対象モジュールについては、お客様は、GPLv2に定める条件に従い利用するものとします。また、お客様はGPL対象モジュールを利用することにより、GPLv2に定める条件に同意したものと見なされます。
  256. 3.非GPLモジュールについては、下記の条件が適用されます。非GPLモジュールについては、お客様は、下記の条件に従い利用するものとします。また、お客様は非GPLモジュールを利用することにより、下記条件に同意したものと見なされます。
  257. (1) 非GPLモジュールに関する著作権は、ブラザーに帰属します。本契約は、非GPLモジュールについてブラザーからお客様に対し著作権の全部若しくは一部を譲渡するものとは解され得ません。
  258. (2) ブラザーはお客様に対し、非GPLモジュールについて複製、譲渡(著作権の譲渡ではなくソフトウェアが格納された媒体の譲渡を指します)、公衆送信、および、改変並びに翻案(改変若しくは翻案された非GPLモジュールの複製、譲渡及び公衆送信を含みます)を行う権利を、無償にて非独占的に許諾します。
  259. (3) お客様は、前号に基づく譲渡及び公衆送信に際し、本契約に定めると同一内容の再使用許諾を受領者に明示的に与えなければなりません。
  260. (4) ブラザーによる非GPLモジュールの配布・提供は、現状有姿にて行われるものであり、ブラザーはお客様に対し、非GPLモジュールに関し、明示・黙示問わず、何らの保証(品質保証・有用性に関する保証・特定目的への合致に関する保証その他一切含め)も行いません。
  261. (5) ブラザーは非GPLモジュールに関し、適用法で認められる限り、お客様に生じたいかなる損害(直接損害・間接損害・特別損害・派生損害・懲罰的損害その他一切含め)についても、かかる損害が予測可能か否か、また、その可能性についてブラザーが知っていたか否かを問わず、賠償義務を負いません。
  262. (6) さらにブラザーはお客様に対し、いかなる場合も非GPLモジュールのソースコードを開示する義務を負いません。上記ブラザーによる改変、翻案に関するライセンスは、いかなる場合にも、非GPLモジュールのソースコード開示に関するブラザーの黙示的な同意とは解釈されません。
  263. GPLBROTHERLICENSE_J
  264. else
  265. cat <<GPLBROTHERLICENSE_U
  266. This Agreement provides terms and conditions for license grant for use of the software that is distributed with this Agreement ("Software") from Brother Industries, Ltd. ("Brother") to recipients thereof ("You").
  267. Note:
  268. Please click on "I Accept" while holding down "Shift" or right click on "I Accept" and select "Save Target As,,," from the menu.
  269. 1.The Software is comprised of the following software modules:
  270. (1) Certain software modules that is the subject of GNU GENERAL PUBLIC LICENSE ("GPL Modules"), and
  271. (2) Other software modules ("Non-GPL Modules")
  272. You may distinguish each of GPL Modules by downloading source files of the Software as Brother separately makes available and reading such files.
  273. 2.Your use of all GPL Modules shall be subject to the terms and conditions of GNU GENERAL PUBLIC LICENSE Version 2, June 1991 ("GPLv2"). Please see http://www.brother.com/agreement/English_gpl/agree.html. You shall use GPL Modules in accordance with the terms and conditions of GPLv2. Your use of GPL Modules shall be deemed as your agreement to the terms and conditions of GPLv2.
  274. 3.You have the right to use all Non-GPL Modules only in accordance with the following terms and conditions. Your use of Non-GPL Modules shall be deemed as your agreement to the following terms and conditions:
  275. (1) Brother retains any and all copyrights to Non-GPL Modules. In no case this Agreement shall be construed to assign or otherwise transfer from Brother to you any copyrights or other intellectual property rights to whole or any part of Non-GPL Modules.
  276. (2) Brother grants you a non-exclusive license to reproduce and/or distribute (via Internet or in any other manner) Non-GPL Modules. Brother further grants you a non-exclusive license to modify, alter, translate or otherwise prepare derivative works of Non-GPL Modules and to reproduce and/or distribute (via Internet or in any other manner) such modification, alteration, translation or other derivative works of Non-GPL Modules.
  277. (3) When you distribute (via Internet or in any other manner) Non-GPL Modules or any modification, alteration, translation or other derivative works thereof under the license granted in accordance with subparagraph 3(2) above, you must expressly grant any and all recipient thereof the license equivalent to this Agreement which applies to Non-GPL Modules.
  278. (4) The license of Non-GPL Modules from Brother hereunder is granted "AS IS. BROTHER HEREBY DISCLAIMS ANY WARRANTIES WITH RESPECT TO NON-GPL MODULES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTY FOR THE QUALITY, MERCHANTABILITY, FITNESS FOR PARTICULAR PURPOSE OR NON-INFRINGEMENT.
  279. (5) To the extent allowed by applicable laws, Brother shall have no liability in contract, tort (including negligence or breach of statutory duty) or otherwise for any interruption of use, loss of data, or for any indirect, incidental, punitive or consequential loss or damage, or for any loss of profit, revenue, data, goodwill or anticipated savings that arises under, out of, or in contemplation of this Agreement or otherwise arises due to any error, inaccuracy or defect in Non-GPL Modules even if Brother has been advised of the possibility of such loss or damage.
  280. (6) The form in which Non-GPL Modules is distributed is subject to Brothers sole discretion. Brother does not have any obligation to distribute or disclose Non-GPL Modules in source code form. In no case shall this Agreement be deemed as Brothers express or implied agreement to disclose source code of Non-GPL Modules.
  281. GPLBROTHERLICENSE_U
  282. fi
  283. }
  284. pdrv_complex_license(){
  285. echo -e $COLOR2
  286. if [ $REGION = JPN ];then
  287. cat <<PDVRLICENSE_J
  288. 本契約は、本契約とともに配布・提供されるソフトウェア (以下単に本ソフトウェアといいます) に関し、本ソフトウェアの著作権者であるブラザー工業株式会社 (以下、ブラザーといいます) から本ソフトウェア受領者 (以下単に利用者といいます) に対し与えられる使用許諾について定めるものです。 利用者は、下記条項に従い本ソフトウェアを利用するものとします。 また、利用者は本ソフトウェアを利用することにより、下記条項に同意したものと見なされます。
  289. 1. 本ソフトウェアに関する著作権は、ブラザーに帰属します。 本契約は、本ソフトウェアについてブラザーから利用者に対し著作権の全部若しくは一部を譲渡するものとは解され得ません。
  290. 2. ブラザーは利用者に対し、本ソフトウェアについて複製、譲渡 (著作権の譲渡ではなくソフトウェアが格納された媒体の譲渡を指します) および公衆送信を行う権利を無償にて非独占的に許諾します。
  291. 3. さらにブラザーは利用者に対し、いかなる目的のためにでも本ソフトウェアを変更、改変、翻訳あるいは本ソフトウェアの派生物を作成し、かつそれらについて複製、譲渡及び公衆送信を行う権利を無償にて非独占的に許諾します。
  292. 4. ブラザーによる本ソフトウェアの配布・提供は、現状有姿にて行われるものであり、ブラザーは利用者に対し、本ソフトウェアに関し、明示・黙示問わず、何らの保証 (品質保証・有用性に関する保証・特定目的への合致に関する保証その他一切含め) も行いません。
  293. 5. ブラザーは本ソフトウェアに関し、利用者に生じたいかなる損害 (直接損害・間接損害・特別損害・派生損害・懲罰的損害その他一切含め) についても、かかる損害が予測可能か否か、また、その可能性についてブラザーが知っていたか否かを問わず、賠償義務を負いません。
  294. 6. さらにブラザーは利用者に対し、いかなる場合も本ソフトウェアのソースコードを開示する義務を負いません。 上記ブラザーによる変更、改変、翻訳あるいは本ソフトウェアの派生物作成に関するライセンスは、いかなる場合にも、本ソフトウェアのソースコード開示に関するブラザーの黙示的な同意とは解釈されません。
  295. 7. 本ソフトウェアには、GNU GENERAL PUBLIC LICENSE Version 2の条件の適用を受けるプログラムが含まれております。第1条から第6項の規定に関わらず、これらのプログラムにはGNU GENERAL PUBLIC LICENSE Version 2の条件が適用されます。これらのプログラムは以下のディレクトリ及びそのサブディレクトリに保存されています。
  296. <cupswrapper>
  297. GNU GENERAL PUBLIC LICENSE
  298. Version 2, June 1991
  299. Copyright (C) 1989, 1991 Free Software Foundation, Inc.
  300. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
  301. Everyone is permitted to copy and distribute verbatim copies
  302. of this license document, but changing it is not allowed.
  303. Preamble
  304. The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too.
  305. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.
  306. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.
  307. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
  308. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.
  309. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations.
  310. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.
  311. The precise terms and conditions for copying, distribution and modification follow.
  312. TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
  313. 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you".
  314. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.
  315. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.
  316. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
  317. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
  318. a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.
  319. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.
  320. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)
  321. These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
  322. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.
  323. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
  324. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:
  325. a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
  326. b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
  327. c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)
  328. The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
  329. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.
  330. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
  331. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.
  332. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.
  333. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.
  334. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.
  335. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
  336. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
  337. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
  338. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
  339. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.
  340. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
  341. NO WARRANTY
  342. 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
  343. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
  344. END OF TERMS AND CONDITIONS
  345. How to Apply These Terms to Your New Programs
  346. If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
  347. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
  348. one line to give the program's name and an idea of what it does.
  349. Copyright (C) yyyy name of author
  350. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
  351. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  352. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  353. Also add information on how to contact you by electronic and paper mail.
  354. If the program is interactive, make it output a short notice like this when it starts in an interactive mode:
  355. Gnomovision version 69, Copyright (C) year name of author
  356. Gnomovision comes with ABSOLUTELY NO WARRANTY; for details
  357. type \`show w'. This is free software, and you are welcome
  358. to redistribute it under certain conditions; type \`show c'
  359. for details.
  360. The hypothetical commands \`show w' and \`show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than \`show w' and \`show c'; they could even be mouse-clicks or menu items--whatever suits your program.
  361. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names:
  362. Yoyodyne, Inc., hereby disclaims all copyright interest in the program \`Gnomovision' (which makes passes at compilers) written by James Hacker.
  363. signature of Ty Coon, 1 April 1989
  364. Ty Coon, President of Vice
  365. This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License.
  366. PDVRLICENSE_J
  367. else
  368. cat <<PDVRLICENSE_U
  369. License Agreement
  370. This Agreement provides terms and conditions for license grant from Brother Industries, Ltd ("Brother"). Brother, who owns all copyrights to the software that is distributed with this Agreement ("Software") to recipients thereof ("User"), for use of the Software. User shall have the right to use the Software only in accordance with the terms and conditions of this Agreement. Any use by User of the Software shall be deemed as its agreement hereto.
  371. Note:
  372. Please click on "I Accept" while holding down "Shift" or right click on "I Accept" and select "Save Target As,,," from the menu.
  373. Brother retains any and all copyrights to the Software. In no case this Agreement shall be construed to assign or otherwise transfer from Brother to User any copyrights or other intellectual property rights to whole or any part of the Software.
  374. Brother grants User a non-exclusive license: to reproduce and/or distribute (via Internet or in any other manner) the Software. Further, Brother grants User a non-exclusive license to modify, alter, translate or otherwise prepare derivative works of the Software and to reproduce and distribute (via Internet or in any other manner) such modification, alteration, translation or other derivative works for any purpose.
  375. The license of the Software from Brother hereunder is granted "AS IS." BROTHER HEREBY DISCLAIMS ANY WARRANTIES WITH RESPECT TO THE SOFTWARE, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO WARRANTY FOR THE QUALITY, MERCHANTABILITY, FITNESS FOR PARTICULAR PURPOSE OR NON-INFRINGEMENT. Brother shall have no liability in contract, tort (including negligence or breach of statutory duty) or otherwise for any interruption of use, loss of data, or for any indirect, incidental, punitive or consequential loss or damage, or for any loss of profit, revenue, data, goodwill or anticipated savings that arises under, out of, or in contemplation of this Agreement or otherwise arises due to any error, inaccuracy or defect in the Software even if Brother has been advised of the possibility of such loss or damage. Further, Brother shall have no liability to disclose and/or distribute the source code of the Software to User under any circumstances. In no case shall the above license by Brother to modify, alter, translate or otherwise prepare derivative works of the Software be construed as Brother's implied agreement or undertakings to disclose and/or distribute the source code of the Software.
  376. The Software contains the programs licensed under the terms and conditions of GNU GENERAL PUBLIC LICENSE Version 2. Notwithstanding the foregoing, the terms and conditions of GNU GENERAL PUBLIC LICENSE Version 2 is applied to such programs. Such programs are stored on the following directory and its sub-directories.
  377. <cupswrapper>
  378. GNU GENERAL PUBLIC LICENSE
  379. Version 2, June 1991
  380. Copyright (C) 1989, 1991 Free Software Foundation, Inc.
  381. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
  382. Everyone is permitted to copy and distribute verbatim copies
  383. of this license document, but changing it is not allowed.
  384. Preamble
  385. The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too.
  386. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.
  387. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.
  388. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
  389. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.
  390. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations.
  391. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.
  392. The precise terms and conditions for copying, distribution and modification follow.
  393. TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
  394. 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you".
  395. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.
  396. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.
  397. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
  398. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
  399. a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.
  400. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.
  401. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)
  402. These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
  403. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.
  404. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
  405. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:
  406. a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
  407. b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
  408. c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)
  409. The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
  410. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.
  411. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
  412. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.
  413. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.
  414. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.
  415. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.
  416. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
  417. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
  418. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
  419. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
  420. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.
  421. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
  422. NO WARRANTY
  423. 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
  424. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
  425. END OF TERMS AND CONDITIONS
  426. How to Apply These Terms to Your New Programs
  427. If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
  428. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
  429. one line to give the program's name and an idea of what it does.
  430. Copyright (C) yyyy name of author
  431. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
  432. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  433. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  434. Also add information on how to contact you by electronic and paper mail.
  435. If the program is interactive, make it output a short notice like this when it starts in an interactive mode:
  436. Gnomovision version 69, Copyright (C) year name of author
  437. Gnomovision comes with ABSOLUTELY NO WARRANTY; for details
  438. type \`show w'. This is free software, and you are welcome
  439. to redistribute it under certain conditions; type \`show c'
  440. for details.
  441. The hypothetical commands \`show w' and \`show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than \`show w' and \`show c'; they could even be mouse-clicks or menu items--whatever suits your program.
  442. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names:
  443. Yoyodyne, Inc., hereby disclaims all copyright interest in the program \`Gnomovision' (which makes passes at compilers) written by James Hacker.
  444. signature of Ty Coon, 1 April 1989
  445. Ty Coon, President of Vice
  446. This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License.
  447. PDVRLICENSE_U
  448. fi
  449. }
  450. TIMEOUT=30
  451. WGET_OP="-T 10 -nd"
  452. WGET_OP2="-nd -T 10 -t 1"
  453. DBG_MSG(){
  454. if [ "$DEBUG_MSG" = 1 ];then
  455. echo -e ${COLOR3}"DEBUGMSG : $1"${MONO}
  456. fi
  457. }
  458. MESSAGE(){
  459. if [ "$MSG" = 1 ];then
  460. echo -e ${COLOR3}"$1"${MONO}
  461. fi
  462. }
  463. install_done=no
  464. preproc_done=''
  465. postproc_done=''
  466. PREPROC=''
  467. POSTPROC=''
  468. pre_install_sweep(){
  469. DBG_MSG pre_install_sweep
  470. ORGC="/etc/init.d/cups"
  471. ORGL="/etc/init.d/lpd"
  472. ORGLN="/etc/init.d/lprng"
  473. SYMLNC="cups -> /etc/init.d/cupsys"
  474. SYMLNL="lpd -> /etc/init.d/cupsys"
  475. SYMLNLN="lprng -> /etc/init.d/cupsys"
  476. if [ "$(ls -al $ORGC 2> /dev/null | grep ^l | grep "$SYMLNC" )" != '' ]
  477. then
  478. rm -f $ORGC 2> /dev/null
  479. fi
  480. if [ "$(ls -al $ORGL 2> /dev/null | grep ^l | grep "$SYMLNL" )" != '' ]
  481. then
  482. rm -f $ORGL 2> /dev/null
  483. fi
  484. if [ "$(ls -al $ORGLN 2> /dev/null | grep ^l | grep "$SYMLNLN")" != '' ]
  485. then
  486. rm -f $ORGLN 2> /dev/null
  487. fi
  488. }
  489. post_install_sweep(){
  490. DBG_MSG post_install_sweep
  491. if [ ! -d ${wkdir}/${modelnhuc} ];then
  492. if [ -f ${wkdir}/${modelnhuc} ];then
  493. rm -f ${wkdir}/${modelnhuc} 2> /dev/null
  494. fi
  495. fi
  496. }
  497. #
  498. # get inf file
  499. # chaged values :
  500. # ${modelnhuc}
  501. # ${fulpath}
  502. #
  503. get_inf_file(){
  504. SUFFIX1="N C D DN DW DWN DWT CN CW CDN CD CDW CDWT DNLT JN J CLN CLWN WR"
  505. DBG_MSG get_inf_file
  506. if [ $NODOWNLOAD = 1 ];then
  507. cp $INFPATH ${wkdir}
  508. modelnhuc=$MODEL
  509. elif [ $NODOWNLOAD = 2 ];then
  510. modelnhuc=$MODEL
  511. else
  512. inputmodel=$1
  513. modelnhuc=$(echo $inputmodel | tr "[a-z]" "[A-Z]" | tr -d '-')
  514. if [ "${modelnhuc}" = '' ];then
  515. echo ERROR :$inputmodel , $1 , ${modelnhuc}
  516. #DBG_MSG "exit 1"
  517. exit 0
  518. fi
  519. fulpath=$URL_INF/${modelnhuc}
  520. dlresult=IDENTIC
  521. if [ $infcheck = 0 ] && [ $HIDE_INF = NO ];then
  522. MESSAGE "wget $WGET_OP $CACHEFLG -P ${wkdir} $fulpath"
  523. fi
  524. fi
  525. wget $WGET_OP $CACHEFLG -P ${wkdir} $fulpath > /dev/null 2> /dev/null
  526. #--------------------------------------
  527. if [ ! -f ${wkdir}/${modelnhuc} ];then
  528. # DCP315C -> DCP315CN
  529. dlresult=APPROX1
  530. modelnhuc2=$(echo $inputmodel | tr "[a-z]" "[A-Z]" | tr -d '-' |\
  531. sed -e s/"[A-Z][A-Z][A-Z][A-Z]$"/""/g \
  532. -e s/"[A-Z][A-Z][A-Z]$"/""/g \
  533. -e s/"[A-Z][A-Z]$"/""/g \
  534. -e s/"[A-Z]$"/""/g )
  535. for suffix in $SUFFIX1
  536. do
  537. modelnhuc=${modelnhuc2}${suffix}
  538. if [ "${modelnhuc}" != '' ];then
  539. fulpath=$URL_INF/${modelnhuc}
  540. if [ $infcheck = 0 ] && [ $HIDE_INF = NO ];then
  541. MESSAGE "wget $WGET_OP $CACHEFLG -P ${wkdir} $fulpath"
  542. fi
  543. wget $WGET_OP $CACHEFLG -P ${wkdir} $fulpath > /dev/null 2> /dev/null
  544. if [ $? = '0' ];then
  545. break
  546. fi
  547. fi
  548. modelnhuc='___not_found___'
  549. done
  550. fi
  551. #--------------------------------------
  552. if [ ! -f ${wkdir}/${modelnhuc} ];then
  553. # DCP315C -> DCP315
  554. dlresult=APPROX2
  555. modelnhuc=$(echo $inputmodel | tr "[a-z]" "[A-Z]" | tr -d '-' |\
  556. sed -e s/"[A-Z][A-Z][A-Z][A-Z]$"/""/g \
  557. -e s/"[A-Z][A-Z][A-Z]$"/""/g \
  558. -e s/"[A-Z][A-Z]$"/""/g \
  559. -e s/"[A-Z]$"/""/g )
  560. if [ "${modelnhuc}" != '' ];then
  561. fulpath=$URL_INF/${modelnhuc}
  562. if [ $infcheck = 0 ] && [ $HIDE_INF = NO ];then
  563. MESSAGE "wget $WGET_OP $CACHEFLG -P ${wkdir} $fulpath"
  564. fi
  565. wget $WGET_OP $CACHEFLG -P ${wkdir} $fulpath > /dev/null 2> /dev/null
  566. fi
  567. fi
  568. #--------------------------------------
  569. if [ ! -f "${wkdir}/${modelnhuc}" ];then
  570. # DCP315C -> DCP310C
  571. dlresult=APPROX3
  572. modelnhuc=$(echo $inputmodel | \
  573. sed -e s/"[0-9]$"/"0"/g \
  574. -e s/"[0-9]C"/"0C"/g \
  575. -e s/"[0-9]D"/"0D"/g \
  576. -e s/"[0-9]W"/"0W"/g \
  577. -e s/"[0-9]N"/"0N"/g )
  578. if [ "${modelnhuc}" != '' ];then
  579. fulpath=$URL_INF/${modelnhuc}
  580. #echo wget $WGET_OP $CACHEFLG -P ${wkdir} $fulpath
  581. if [ $infcheck = 0 ] && [ $HIDE_INF = NO ];then
  582. MESSAGE "wget $WGET_OP $CACHEFLG -P ${wkdir} $fulpath"
  583. fi
  584. wget $WGET_OP $CACHEFLG -P ${wkdir} $fulpath > /dev/null 2> /dev/null
  585. fi
  586. fi
  587. #--------------------------------------
  588. if [ ! -f ${wkdir}/${modelnhuc} ];then
  589. # DCP315C -> DCP310CN
  590. dlresult=APPROX4
  591. modelnhuc2=$(echo $inputmodel | tr "[a-z]" "[A-Z]" | tr -d '-' |\
  592. sed -e s/"[A-Z][A-Z][A-Z][A-Z]$"/""/g \
  593. -e s/"[A-Z][A-Z][A-Z]$"/""/g \
  594. -e s/"[A-Z][A-Z]$"/""/g \
  595. -e s/"[A-Z]$"/""/g |\
  596. sed s/"[0-9]$"/"0"/g )
  597. for suffix in $SUFFIX1
  598. do
  599. modelnhuc=${modelnhuc2}${suffix}
  600. if [ "${modelnhuc}" != '' ];then
  601. fulpath=$URL_INF/${modelnhuc}
  602. if [ $infcheck = 0 ] && [ $HIDE_INF = NO ];then
  603. MESSAGE "wget $WGET_OP $CACHEFLG -P ${wkdir} $fulpath"
  604. fi
  605. wget $WGET_OP $CACHEFLG -P ${wkdir} $fulpath > /dev/null 2> /dev/null
  606. if [ $? = '0' ];then
  607. break
  608. fi
  609. fi
  610. modelnhuc='___not_found___'
  611. done
  612. fi
  613. #--------------------------------------
  614. if [ ! -f ${wkdir}/${modelnhuc} ];then
  615. # DCP315C -> DCP310
  616. dlresult=APPROX5
  617. modelnhuc=$(echo $inputmodel | tr "[a-z]" "[A-Z]" | tr -d '-' |\
  618. sed -e s/"[A-Z][A-Z][A-Z][A-Z]$"/""/g \
  619. -e s/"[A-Z][A-Z][A-Z]$"/""/g \
  620. -e s/"[A-Z][A-Z]$"/""/g \
  621. -e s/"[A-Z]$"/""/g |\
  622. sed s/"[0-9]$"/"0"/g )
  623. if [ "${modelnhuc}" != '' ];then
  624. fulpath=$URL_INF/${modelnhuc}
  625. if [ $infcheck = 0 ] && [ $HIDE_INF = NO ];then
  626. MESSAGE "wget $WGET_OP $CACHEFLG -P ${wkdir} $fulpath"
  627. fi
  628. wget $WGET_OP $CACHEFLG -P ${wkdir} $fulpath > /dev/null 2> /dev/null
  629. fi
  630. if [ ! -f ${wkdir}/${modelnhuc} ];then
  631. modelnhuc='___not_found___'
  632. fi
  633. fi
  634. #--------------------------------------
  635. if [ -f ${wkdir}/${modelnhuc} ];then
  636. lnk=$(grep "LNK=" ${wkdir}/${modelnhuc} 2>/dev/null | sed s/'LNK='//g)
  637. if [ "$lnk" != '' ];then
  638. PRODUCT_NAME=$(grep "^\[" ${wkdir}/${modelnhuc} 2>/dev/null | sed -e s/"\["//g -e s/"\]"//g)
  639. PREPROC=$(grep "PREPROC=" ${wkdir}/${modelnhuc} 2>/dev/null | \
  640. sed s/"PREPROC="//g | \
  641. sed -e s/^\"//g -e s/\"$//g )
  642. POSTPROC=$(grep "POSTPROC=" ${wkdir}/${modelnhuc} 2>/dev/null | \
  643. sed s/"POSTPROC="//g | \
  644. sed -e s/^\"//g -e s/\"$//g )
  645. lnk_flag="LINK"
  646. LNK_PRINTERNAME=$(grep "PRINTERNAME" ${wkdir}/${modelnhuc} \
  647. 2>/dev/null | sed s/"PRINTERNAME="//g )
  648. if [ -f ${wkdir}/${modelnhuc} ];then
  649. rm -f ${wkdir}/${modelnhuc} 2> /dev/null
  650. fi
  651. modelnhuc=${lnk}
  652. fulpath=$URL_INF/${modelnhuc}
  653. if [ $infcheck = 0 ] && [ $HIDE_INF = NO ];then
  654. MESSAGE "wget $WGET_OP $CACHEFLG -P ${wkdir} $fulpath"
  655. fi
  656. wget $WGET_OP $CACHEFLG -P ${wkdir} $fulpath > /dev/null 2> /dev/null
  657. fi
  658. fi
  659. if [ "$modelnhuc" = '___not_found___' ];then
  660. modelnhuc=''
  661. fi
  662. }
  663. get_packages_name(){
  664. DBG_MSG get_packages_name
  665. inf=${wkdir}/$1
  666. if [ "$PRODUCT_NAME" = '' ];then
  667. PRODUCT_NAME=$(grep "\[" $inf 2>/dev/null | sed -e s/"\["//g -e s/"\]"//g)
  668. fi
  669. SCANNER_DRV=$(grep "SCANNER_DRV" $inf 2>/dev/null | sed s/"SCANNER_DRV="//g )
  670. SCANKEY_DRV=$(grep "SCANKEY_DRV" $inf 2>/dev/null | sed s/"SCANKEY_DRV="//g )
  671. PRINTERNAME=$(grep "PRINTERNAME" $inf 2>/dev/null | sed s/"PRINTERNAME="//g )
  672. if [ "$SCANNER_DRV" != '' ];then
  673. SCANNER_LNK="$SCANNER_DRV".lnk
  674. fulpath=$URL_INF/$SCANNER_LNK
  675. if [ $infcheck = 0 ] && [ $HIDE_INF = NO ];then
  676. echo wget $WGET_OP $CACHEFLG -P ${wkdir} $fulpath
  677. fi
  678. wget $WGET_OP $CACHEFLG -P ${wkdir} $fulpath 2> /dev/null
  679. fi
  680. if [ "$SCANKEY_DRV" != '' ];then
  681. SCANKEY_LNK="$SCANKEY_DRV".lnk
  682. fulpath=$URL_INF/$SCANKEY_LNK
  683. if [ $infcheck = 0 ] && [ $HIDE_INF = NO ];then
  684. echo wget $WGET_OP $CACHEFLG -P ${wkdir} $fulpath
  685. fi
  686. wget $WGET_OP $CACHEFLG -P ${wkdir} $fulpath 2> /dev/null
  687. fi
  688. if [ "$PKG" = rpm ];then
  689. CUPSFILE=$(grep "PRN_CUP_RPM" $inf 2>/dev/null | sed s/"PRN_CUP_RPM="//g )
  690. LPRFILE=$(grep "PRN_LPD_RPM" $inf 2>/dev/null | sed s/"PRN_LPD_RPM="//g )
  691. PDRVFILE=$(grep "PRN_DRV_RPM" $inf 2>/dev/null | sed s/"PRN_DRV_RPM="//g )
  692. REQ32LIB=$(grep "REQUIRE32LIB" $inf 2>/dev/null| sed s/"REQUIRE32LIB="//g )
  693. if [ "$SCANNER_LNK" != '' ];then
  694. if [ "$arch" = 'i386' ];then
  695. SCANFILE=$(grep "RPM32=" ${wkdir}/"$SCANNER_LNK" | sed s/"RPM32="//g )
  696. else
  697. SCANFILE=$(grep "RPM64=" ${wkdir}/"$SCANNER_LNK" | sed s/"RPM64="//g )
  698. fi
  699. fi
  700. if [ "$SCANKEY_LNK" != '' ];then
  701. if [ "$arch" = 'i386' ];then
  702. SKEYFILE=$(grep "RPM32=" ${wkdir}/"$SCANKEY_LNK" | sed s/"RPM32="//g )
  703. else
  704. SKEYFILE=$(grep "RPM64=" ${wkdir}/"$SCANKEY_LNK" | sed s/"RPM64="//g )
  705. fi
  706. fi
  707. else
  708. CUPSFILE=$(grep "PRN_CUP_DEB" $inf 2>/dev/null | sed s/"PRN_CUP_DEB="//g )
  709. LPRFILE=$(grep "PRN_LPD_DEB" $inf 2>/dev/null | sed s/"PRN_LPD_DEB="//g )
  710. PDRVFILE=$(grep "PRN_DRV_DEB" $inf 2>/dev/null | sed s/"PRN_DRV_DEB="//g )
  711. REQ32LIB=$(grep "REQUIRE32LIB" $inf 2>/dev/null| sed s/"REQUIRE32LIB="//g )
  712. if [ "$SCANNER_LNK" != '' ];then
  713. if [ "$arch" = 'i386' ];then
  714. SCANFILE=$(grep "DEB32=" ${wkdir}/"$SCANNER_LNK" | sed s/"DEB32="//g )
  715. else
  716. SCANFILE=$(grep "DEB64=" ${wkdir}/"$SCANNER_LNK" | sed s/"DEB64="//g )
  717. fi
  718. fi
  719. if [ "$SCANKEY_LNK" != '' ];then
  720. if [ "$arch" = 'i386' ];then
  721. SKEYFILE=$(grep "DEB32=" ${wkdir}/"$SCANKEY_LNK" | sed s/"DEB32="//g )
  722. else
  723. SKEYFILE=$(grep "DEB64=" ${wkdir}/"$SCANKEY_LNK" | sed s/"DEB64="//g )
  724. fi
  725. fi
  726. fi
  727. if [ "$PREPROC" = '' ];then
  728. PREPROC=$(grep "PREPROC=" $inf 2>/dev/null | \
  729. sed s/"PREPROC="//g | \
  730. sed -e s/^\"//g -e s/\"$//g )
  731. fi
  732. if [ "$POSTPROC" = '' ];then
  733. POSTPROC=$(grep "POSTPROC=" $inf 2>/dev/null | \
  734. sed s/"POSTPROC="//g | \
  735. sed -e s/^\"//g -e s/\"$//g )
  736. fi
  737. if [ -f "$inf" ];then
  738. rm -f "$inf" 2> /dev/null
  739. fi
  740. if [ -f ${wkdir}/"$SCANNER_LNK" ] && [ "$SCANNER_LNK" != '' ];then
  741. rm -f ${wkdir}/"$SCANNER_LNK" 2> /dev/null
  742. fi
  743. if [ -f ${wkdir}/"$SCANKEY_LNK" ] && [ "$SCANKEY_LNK" != '' ];then
  744. rm -f ${wkdir}/"$SCANKEY_LNK" 2> /dev/null
  745. fi
  746. }
  747. HOSTDEFAULT="www.brother.com"
  748. HOSTINFJP=$HOSTDEFAULT
  749. HOSTINFUS=$HOSTDEFAULT
  750. HOSTPKGJP=$HOSTDEFAULT
  751. HOSTPKGUS=$HOSTDEFAULT
  752. DBG_MSG BROTHERSOLUTIONSCENTOR_HOSTINFJP=$BROTHERSOLUTIONSCENTOR_HOSTINFJP
  753. DBG_MSG BROTHERSOLUTIONSCENTOR_HOSTINFUS=$BROTHERSOLUTIONSCENTOR_HOSTINFUS
  754. DBG_MSG BROTHERSOLUTIONSCENTOR_HOSTPKGJP=$BROTHERSOLUTIONSCENTOR_HOSTPKGJP
  755. DBG_MSG BROTHERSOLUTIONSCENTOR_HOSTPKGUS=$BROTHERSOLUTIONSCENTOR_HOSTPKGUS
  756. if [ "$BROTHERSOLUTIONSCENTOR_HOSTINFJP" != '' ];then
  757. HOSTINFJP=$BROTHERSOLUTIONSCENTOR_HOSTINFJP
  758. fi
  759. if [ "$BROTHERSOLUTIONSCENTOR_HOSTINFUS" != '' ];then
  760. HOSTINFUS=$BROTHERSOLUTIONSCENTOR_HOSTINFUS
  761. fi
  762. if [ "$BROTHERSOLUTIONSCENTOR_HOSTPKGJP" != '' ];then
  763. HOSTPKGJP=$BROTHERSOLUTIONSCENTOR_HOSTPKGJP
  764. fi
  765. if [ "$BROTHERSOLUTIONSCENTOR_HOSTPKGUS" != '' ];then
  766. HOSTPKGUS=$BROTHERSOLUTIONSCENTOR_HOSTPKGUS
  767. fi
  768. BASEPATHJP="/pub/bsc/linuxj/"
  769. BASEPATHUS="/pub/bsc/linux/"
  770. set_host_info(){
  771. DBG_MSG set_host_info
  772. if [ "$1" = "JPN" ];then
  773. URL_INF="http://"${HOSTINFJP}${BASEPATHJP}infs
  774. URL_PKG="http://"${HOSTPKGJP}${BASEPATHJP}packages
  775. else
  776. URL_INF="http://"${HOSTINFUS}${BASEPATHUS}infs
  777. URL_PKG="http://"${HOSTPKGUS}${BASEPATHUS}packages
  778. fi
  779. DBG_MSG " URL_INF="$URL_INF
  780. DBG_MSG " URL_PKG="$URL_PKG
  781. }
  782. network_check(){
  783. netchkpage=$1
  784. if [ "${wkdir}" != '' ] && [ "$netchkpage" != '' ];then
  785. if [ -f ${wkdir}/$netchkpage ];then
  786. rm ${wkdir}/$netchkpage 2> /dev/null
  787. fi
  788. fi
  789. fulpath2="http://"${HOSTINFUS}${BASEPATHUS}infs/$netchkpage
  790. wget $WGET_OP2 $CACHEFLG -P ${wkdir} $fulpath2 > /dev/null 2> /dev/null
  791. rcwget=$?
  792. netaccess=FALSE
  793. if [ -f ${wkdir}/$netchkpage ];then
  794. netaccess=SUCCESS
  795. rm ${wkdir}/$netchkpage 2> /dev/null
  796. fi
  797. }
  798. drv_get_and_install(){
  799. DBG_MSG drv_get_and_install
  800. package=$1
  801. license=$2
  802. default=$3
  803. iinstall_result=No
  804. if [ "$package" != '' ];then
  805. echo -e $COLOR4$MESSAGE150$MONO #"You are going to install ...."
  806. echo -e $COLOR4" "$package$MONO
  807. if [ "$default" = No ];then
  808. echo -e -n $COLOR$MESSAGE160 #"OK\? [y/N] ->"
  809. answer=""
  810. read answer
  811. echo -e $MONO
  812. if [ "$answer" = Y ] || [ "$answer" = y ]; then
  813. if ! [ -f "$package" ];then
  814. $license
  815. echo -e -n $COLOR$MESSAGE170 #"Are you agree\? [Y/n] ->"
  816. answer=""
  817. read answer
  818. echo -e $MONO
  819. if [ "$answer" != N ] && [ "$answer" != n ]; then
  820. echo wget $WGET_OP $CACHEFLG $URL_PKG/$package
  821. wget $WGET_OP $CACHEFLG $URL_PKG/$package
  822. fi
  823. if [ -f "$package" ];then
  824. echo -n -e $COLOR4
  825. echo $PKGCMD $package
  826. echo -n -e $MONO
  827. if [ "$DEBUG_NOINSTALL" != 'yes' ];then
  828. pre_proc
  829. $PKGCMD $package
  830. else
  831. sleep 1
  832. fi
  833. iinstall_result=Yes
  834. fi
  835. fi
  836. fi #answer
  837. elif [ "$default" = Yes ];then
  838. echo -e -n $COLOR$MESSAGE165 #"OK\? [Y/n] ->"
  839. answer=""
  840. read answer
  841. echo -e $MONO
  842. if [ "$answer" != N ] && [ "$answer" != n ]; then
  843. if ! [ -f "$package" ];then
  844. $license
  845. echo -e -n $COLOR$MESSAGE170 #"Are you agree\? [Y/n] ->"
  846. answer=""
  847. read answer
  848. echo -e $MONO
  849. if [ "$answer" != N ] && [ "$answer" != n ]; then
  850. echo wget $WGET_OP $CACHEFLG $URL_PKG/$package
  851. wget $WGET_OP $CACHEFLG $URL_PKG/$package
  852. fi
  853. if [ -f "$package" ];then
  854. echo -n -e $COLOR4
  855. echo $PKGCMD $package
  856. echo -n -e $MONO
  857. if [ "$DEBUG_NOINSTALL" != 'yes' ];then
  858. pre_proc
  859. $PKGCMD $package
  860. else
  861. sleep 1
  862. fi
  863. iinstall_result=Yes
  864. fi
  865. fi
  866. fi #answer
  867. else # deault = Force
  868. if ! [ -f "$package" ];then
  869. $license
  870. echo -e -n $COLOR$MESSAGE170 #"Are you agree\? [Y/n] ->"
  871. answer=""
  872. read answer
  873. echo -e $MONO
  874. if [ "$answer" != N ] && [ "$answer" != n ]; then
  875. echo wget $WGET_OP $CACHEFLG $URL_PKG/$package
  876. wget $WGET_OP $CACHEFLG $URL_PKG/$package
  877. fi
  878. fi
  879. if [ -f "$package" ];then
  880. echo -n -e $COLOR4
  881. echo $PKGCMD $package
  882. echo -n -e $MONO
  883. if [ "$DEBUG_NOINSTALL" != 'yes' ];then
  884. pre_proc
  885. $PKGCMD $package
  886. iinstall_result=Yes
  887. else
  888. sleep 1
  889. fi
  890. fi
  891. fi #default
  892. fi #package
  893. }
  894. make_generic_uninstaller(){
  895. DBG_MSG make_generic_uninstaller
  896. if [ -f $1 ];then
  897. generic_uninstaller=uninstaller_$2
  898. cat <<GENERICUNINST > $generic_uninstaller
  899. #! /bin/bash
  900. $RMPKGCMD $2
  901. $(rmscanlibmodules $3)
  902. GENERICUNINST
  903. chmod 744 $generic_uninstaller
  904. fi
  905. }
  906. make_brscan_uninstaller(){
  907. DBG_MSG make_brscan_uninstaller
  908. if [ -f $1 ];then
  909. brscan_uninstaller=uninstaller_$2
  910. cat <<BRSCANUNINST > $brscan_uninstaller
  911. #! /bin/bash
  912. touch /usr/local/Brother/sane/dummy
  913. $RMPKGCMD $2
  914. rm -f /usr/local/Brother/sane/dummy
  915. rmdir --ignore-fail-on-non-empty /usr/local/Brother/sane 2>/dev/null
  916. $(rmscanlibmodules $3)
  917. BRSCANUNINST
  918. chmod 744 $brscan_uninstaller
  919. fi
  920. }
  921. make_brscan2_uninstaller(){
  922. DBG_MSG make_brscan2_uninstaller
  923. if [ -f $1 ];then
  924. brscan2_uninstaller=uninstaller_$2
  925. cat <<BRSCAN2UNINST > $brscan2_uninstaller
  926. #! /bin/bash
  927. touch /usr/local/Brother/sane/dummy
  928. $RMPKGCMD $2
  929. rm -f /usr/local/Brother/sane/dummy
  930. rmdir --ignore-fail-on-non-empty /usr/local/Brother/sane 2>/dev/null
  931. $(rmscanlibmodules $3)
  932. BRSCAN2UNINST
  933. chmod 744 $brscan2_uninstaller
  934. fi
  935. }
  936. scanlibmodules1="\
  937. libbrcolm.so.1.0.1 \
  938. libbrscandec.so.1.0.0 \
  939. sane/libsane-brother.so.1.0.7 \
  940. sane/libsane-brother.so \
  941. sane/libsane-brother.so.1 \
  942. libbrscandec.so.1 \
  943. libbrcolm.so \
  944. libbrcolm.so.1 \
  945. libbrscandec.so"
  946. scanlibmodules2="\
  947. libbrscandec2.so.1.0.0 \
  948. sane/libsane-brother2.so.1.0.7 \
  949. sane/libsane-brother2.so.1 \
  950. sane/libsane-brother2.so \
  951. libbrcolm2.so.1.0.1 \
  952. libbrcolm2.so \
  953. libbrscandec2.so.1 \
  954. libbrscandec2.so \
  955. libbrcolm2.so.1"
  956. scanlibmodules3="\
  957. libbrscandec3.so.1.0.0 \
  958. sane/libsane-brother3.so.1.0.7 \
  959. sane/libsane-brother3.so.1 \
  960. sane/libsane-brother3.so \
  961. libbrscandec3.so \
  962. libbrscandec3.so.1"
  963. scanlibmodules4=""
  964. dellist=''
  965. cpscanlibmodules(){
  966. for file in $1
  967. do
  968. lib64mod=/usr/lib64/$file
  969. libmod=/usr/lib/$file
  970. if [ -f $lib64mod ];then
  971. if [ -d /usr/lib ];then
  972. if [ ! -f $libmod ];then
  973. cp $lib64mod $libmod 2> /dev/null
  974. if [ -f $libmod ];then
  975. dellist2=$(echo $dellist $libmod)
  976. dellist=$dellist2
  977. fi
  978. fi
  979. fi
  980. fi
  981. done
  982. }
  983. rmscanlibmodules(){
  984. for file in $dellist
  985. do
  986. for check in $*
  987. do
  988. chkresult=$(echo $file | grep $check\$ )
  989. if [ "$chkresult" != '' ];then
  990. echo rm -f $file
  991. fi
  992. done
  993. done
  994. }
  995. udevrulefile=""
  996. udev_installed=no
  997. udev_install(){
  998. libsanerule=$(ls /lib/udev/rules.d/*.rules /etc/udev/rules.d/*.rules | \
  999. grep libsane | head --line=1)
  1000. number=$(echo $libsanerule | \
  1001. sed s/"\/lib\/udev\/rules.d\/"//g |\
  1002. sed s/"\/etc\/udev\/rules.d\/"//g |\
  1003. head --bytes=2)
  1004. chk=$(echo $number | grep "[0-9][0-9]")
  1005. if [ "$chk" = '' ];then
  1006. libsanerule=$(ls /lib/udev/rules.d/*.rules /etc/udev/rules.d/*.rules | \
  1007. grep sane-backends | head --line=1)
  1008. number=$(echo $libsanerule | \
  1009. sed s/"\/lib\/udev\/rules.d\/"//g |\
  1010. sed s/"\/etc\/udev\/rules.d\/"//g |\
  1011. head --bytes=2)
  1012. fi
  1013. chk=$(echo $number | grep "[0-9][0-9]")
  1014. if [ "$chk" != '' ];then
  1015. chk=$(grep "ENV{libsane_matched}=\"yes\"" $libsanerule | tail -1)
  1016. if [ "$chk" != '' ];then
  1017. ####
  1018. udevrulefile="/etc/udev/rules.d/${number}-brother-libsane-type1-inst.rules"
  1019. cat << %%_UDEV_RULE_%% > $udevrulefile
  1020. #
  1021. # udev rules sample for Brother MFP
  1022. # version 1.0.2-0
  1023. #
  1024. # Copyright (C) 2012-2017 Brother. Industries, Ltd.
  1025. #
  1026. # copy to /etc/udev/rules.d or /lib/udev/rules.d
  1027. #
  1028. ACTION!="add", GOTO="brother_mfp_end"
  1029. SUBSYSTEM=="usb", GOTO="brother_mfp_udev_1"
  1030. SUBSYSTEM!="usb_device", GOTO="brother_mfp_end"
  1031. LABEL="brother_mfp_udev_1"
  1032. SYSFS{idVendor}=="04f9", GOTO="brother_mfp_udev_2"
  1033. ATTRS{idVendor}=="04f9", GOTO="brother_mfp_udev_2"
  1034. GOTO="brother_mfp_end"
  1035. LABEL="brother_mfp_udev_2"
  1036. ATTRS{bInterfaceClass}!="0ff", GOTO="brother_mfp_end"
  1037. ATTRS{bInterfaceSubClass}!="0ff", GOTO="brother_mfp_end"
  1038. ATTRS{bInterfaceProtocol}!="0ff", GOTO="brother_mfp_end"
  1039. #MODE="0666"
  1040. #GROUP="scanner"
  1041. ENV{libsane_matched}="yes"
  1042. #SYMLINK+="scanner-%k"
  1043. LABEL="brother_mfp_end"
  1044. %%_UDEV_RULE_%%
  1045. ####
  1046. chmod 644 $udevrulefile
  1047. udev_installed=yes
  1048. fi
  1049. fi
  1050. }
  1051. scanner_install(){
  1052. DBG_MSG scanner_install
  1053. case "$SCANNER_DRV" in
  1054. "brscan")
  1055. drv_get_and_install $SCANFILE gpl_and_br_license Force
  1056. if [ $iinstall_result = Yes ];then
  1057. cpscanlibmodules "$scanlibmodules1"
  1058. make_brscan_uninstaller $SCANFILE "$SCANNER_DRV" "$scanlibmodules1"
  1059. install_done=yes
  1060. fi
  1061. scanconfig=brsaneconfig
  1062. drv_get_and_install $SKEYFILE brother_license Force
  1063. if [ $iinstall_result = Yes ];then
  1064. dellist=''
  1065. make_generic_uninstaller $SKEYFILE brscan-skey
  1066. install_done=yes
  1067. fi
  1068. ;;
  1069. "brscan2")
  1070. drv_get_and_install $SCANFILE gpl_and_br_license Force
  1071. if [ $iinstall_result = Yes ];then
  1072. cpscanlibmodules "$scanlibmodules2"
  1073. make_brscan2_uninstaller $SCANFILE "$SCANNER_DRV" "$scanlibmodules2"
  1074. install_done=yes
  1075. fi
  1076. scanconfig=brsaneconfig2
  1077. drv_get_and_install $SKEYFILE brother_license Force
  1078. if [ $iinstall_result = Yes ];then
  1079. dellist=''
  1080. make_generic_uninstaller $SKEYFILE brscan-skey
  1081. install_done=yes
  1082. fi
  1083. ;;
  1084. "brscan3")
  1085. drv_get_and_install $SCANFILE gpl_and_br_license Force
  1086. if [ $iinstall_result = Yes ];then
  1087. cpscanlibmodules "$scanlibmodules3"
  1088. make_generic_uninstaller $SCANFILE "$SCANNER_DRV" "$scanlibmodules3"
  1089. install_done=yes
  1090. fi
  1091. scanconfig=brsaneconfig3
  1092. drv_get_and_install $SKEYFILE brother_license Force
  1093. if [ $iinstall_result = Yes ];then
  1094. dellist=''
  1095. make_generic_uninstaller $SKEYFILE brscan-skey
  1096. install_done=yes
  1097. fi
  1098. ;;
  1099. "brscan4")
  1100. drv_get_and_install $SCANFILE brother_license Force
  1101. if [ $iinstall_result = Yes ];then
  1102. cpscanlibmodules "$scanlibmodules4"
  1103. make_generic_uninstaller $SCANFILE "$SCANNER_DRV" "$scanlibmodules4"
  1104. install_done=yes
  1105. fi
  1106. scanconfig=brsaneconfig4
  1107. drv_get_and_install $SKEYFILE brother_license Force
  1108. if [ $iinstall_result = Yes ];then
  1109. dellist=''
  1110. make_generic_uninstaller $SKEYFILE brscan-skey
  1111. install_done=yes
  1112. fi
  1113. ;;
  1114. "brscan5")
  1115. drv_get_and_install $SCANFILE brother_license Force
  1116. if [ $iinstall_result = Yes ];then
  1117. cpscanlibmodules "$scanlibmodules5"
  1118. make_generic_uninstaller $SCANFILE "$SCANNER_DRV" "$scanlibmodules5"
  1119. install_done=yes
  1120. fi
  1121. scanconfig=brsaneconfig5
  1122. drv_get_and_install $SKEYFILE brother_license Force
  1123. if [ $iinstall_result = Yes ];then
  1124. dellist=''
  1125. make_generic_uninstaller $SKEYFILE brscan-skey
  1126. install_done=yes
  1127. fi
  1128. ;;
  1129. * )
  1130. ;;
  1131. esac
  1132. udev_install
  1133. if [ $udev_installed = yes ];then
  1134. echo rm $udevrulefile >> uninstaller_${SCANNER_DRV}
  1135. fi
  1136. # install libusb-0.1-4 if not available
  1137. libusbchk=$(ls -R /lib /usr/lib /usr/sbin | grep 'libusb-0.1.so.4')
  1138. if [ "$libusbchk" = '' ];then
  1139. if [ "$(which apt-get 2>/dev/null)" != '' ];then
  1140. echo apt-get install libusb-0.1-4
  1141. apt-get install libusb-0.1-4
  1142. fi
  1143. fi
  1144. # libusb-0.1-4
  1145. post_proc
  1146. if [ "$scanconfig" != '' ] && \
  1147. [ "$PRODUCT_NAME" != '' ] && \
  1148. [ -f "$(which $scanconfig)" ];then
  1149. if [ "$(echo $deviceuri | grep 'usb://')" = '' ];then
  1150. if [ "$(echo $deviceuri | grep 'file://')" = '' ];then
  1151. if [ "$ipadrs" = '' ];then
  1152. echo -e -n $COLOR$MESSAGE220 #" enter IP address ->"
  1153. read ipadrs
  1154. echo -e $MONO
  1155. fi
  1156. fi
  1157. echo -n -e $COLOR4
  1158. echo $scanconfig -a name=$PRODUCT_NAME model=$PRODUCT_NAME ip=$ipadrs
  1159. echo -n -e $MONO
  1160. $scanconfig -a name=$PRODUCT_NAME model=$PRODUCT_NAME ip=$ipadrs
  1161. fi
  1162. fi
  1163. }
  1164. pre_proc(){
  1165. if [ "$preproc_done" = '' ];then
  1166. if [ "$PREPROC" != '' ];then
  1167. echo "$PREPROC" | /bin/bash
  1168. fi
  1169. fi
  1170. preproc_done=done
  1171. }
  1172. post_proc(){
  1173. if [ "$install_done" = yes ];then
  1174. if [ "$postproc_done" = '' ];then
  1175. if [ "$POSTPROC" != '' ];then
  1176. echo "$POSTPROC" | /bin/bash
  1177. fi
  1178. fi
  1179. postproc_done=done
  1180. fi
  1181. }
  1182. cleanup_deb_cups_pkg(){
  1183. if [ "$PKG" = deb ];then
  1184. if [ "$(which awk 2> /dev/null)" != '' ];then
  1185. installedpkgs=$($LSPKGCMD | grep -i cups | grep -i brother | \
  1186. awk '{print $2}')
  1187. for pkg in $installedpkgs
  1188. do
  1189. pkg2=$(echo $pkg | sed s/":.*$"//g)
  1190. if [ "$(echo $CUPSFILE | grep $pkg2 )" != '' ];then
  1191. $RMPKGCMD $pkg
  1192. break
  1193. fi
  1194. done
  1195. fi
  1196. fi
  1197. }
  1198. ipadrs=''
  1199. deviceuri="usb://"
  1200. PRODUCT_NAME=''
  1201. #
  1202. # START (MAIN)
  1203. #
  1204. HIDE_INF=YES
  1205. if [ "$(echo $0 | grep linux-brjprinter-installer)" = '' ];then
  1206. REGION=US
  1207. else
  1208. REGION=JPN
  1209. fi
  1210. DBG_MSG MAIN
  1211. dlresult=IDENTIC
  1212. lnk_flag=' '
  1213. if [ "$1" = '-h' ] || [ "$1" = '--help' ];then
  1214. echo -e $COLOR"$MESSAGE010"$0"$MESSAGE020"$MONO #"USAGE: $0 model"
  1215. echo -e $COLOR"$MESSAGE012"$0"$MESSAGE030"$MONO #"USAGE: $0 -f model"
  1216. echo -e $COLOR"$MESSAGE012"$0"$MESSAGE040"$MONO #"USAGE: $0 -l "
  1217. #DBG_MSG "exit 2"
  1218. exit 0
  1219. fi
  1220. if [ $(whoami) != 'root' ];then
  1221. echo -e $COLOR$MESSAGE050$MONO #"Only root can do this operation."
  1222. #DBG_MSG "exit 5"
  1223. exit 0
  1224. fi
  1225. if [ ! -f /etc/init.d/cups ] && [ ! -f /etc/init.d/cupsys ];then
  1226. if [ "$(which lpadmin 2> /dev/null)" = '' ];then
  1227. echo -e $COLOR$MESSAGE060$MONO #"CUPS is not installed."
  1228. if [ "$1" = '' ];then
  1229. echo -e -n $COLOR$MESSAGE240$MONO #"Hit Return/Enter Key"
  1230. read answer
  1231. fi
  1232. #DBG_MSG "exit 6"
  1233. exit 0
  1234. fi
  1235. fi
  1236. LIB64FLT=/usr/lib64/cups/filter
  1237. LIB32FLT=/usr/lib32/cups/filter
  1238. LIBFLT=/usr/lib/cups/filter
  1239. TESTPRINT=/usr/share/cups/data/testprint.ps
  1240. TESTPRINT2=/usr/share/cups/data/testprint
  1241. ## sweep
  1242. pre_install_sweep
  1243. package_list=NO
  1244. CACHEFLG='--no-cache'
  1245. infcheck=0
  1246. if [ "$1" = '--inf-check=1' ];then
  1247. infcheck=1
  1248. package_list=TEXT
  1249. fi
  1250. if [ "$1" = '--inf-check=2' ];then
  1251. infcheck=2
  1252. package_list=CSV
  1253. fi
  1254. if [ "$1" = '--inf-check=3' ];then
  1255. infcheck=3
  1256. package_list=CSV
  1257. fi
  1258. if [ "$1" = '--inf-check=4' ];then
  1259. infcheck=4
  1260. package_list=CSV
  1261. fi
  1262. if [ "$1" = '--inf-check=5' ];then
  1263. infcheck=5
  1264. package_list=CSV
  1265. fi
  1266. if [ package_list = TEXT ];then
  1267. echo -e -n $MONO
  1268. fi
  1269. if [ "$(which wget 2> /dev/null)" = '' ];then
  1270. if [ "$(which yum 2>/dev/null)" != '' ];then
  1271. echo yum install wget
  1272. yum install wget
  1273. elif [ "$(which dnf 2>/dev/null)" != '' ];then
  1274. echo dnf install wget
  1275. dnf install wget
  1276. elif [ "$(which apt-get 2>/dev/null)" != '' ];then
  1277. echo apt-get install wget
  1278. apt-get install wget
  1279. fi
  1280. fi
  1281. if [ "$(which wget 2> /dev/null)" = '' ];then
  1282. echo -e -n $COLOR$MESSAGE280 #"wget is required."
  1283. echo -e $MONO
  1284. #DBG_MSG "exit 7"
  1285. exit 0
  1286. fi
  1287. post_install_sweep
  1288. if [ "$(which dpkg 2> /dev/null)" != '' ];then
  1289. PKG=deb
  1290. elif [ "$(which rpm 2> /dev/null)" != '' ];then
  1291. PKG=rpm
  1292. else
  1293. echo -e $COLOR$MESSAGE122$MONO #"Rpm or dpkg is required."
  1294. post_install_sweep
  1295. if [ "$1" = '' ];then
  1296. echo -e -n $COLOR$MESSAGE240$MONO #"Hit Return/Enter Key"
  1297. read answer
  1298. fi
  1299. #DBG_MSG "exit 9"
  1300. exit 0
  1301. fi
  1302. if [ "$PKG" = deb ];then
  1303. if [ "$(which awk 2> /dev/null)" = '' ];then
  1304. if [ "$(which apt-get 2>/dev/null)" != '' ];then
  1305. echo apt-get install mawk
  1306. apt-get install mawk
  1307. fi
  1308. fi
  1309. fi
  1310. if [ "$BROTHER_INSRALLER_FAKE_PKG" != '' ];then
  1311. PKG=$BROTHER_INSRALLER_FAKE_PKG
  1312. fi
  1313. if [ "$PKG" = deb ];then
  1314. PKGCMD='dpkg -i --force-all'
  1315. RMPKGCMD='dpkg -P'
  1316. LSPKGCMD='dpkg --list'
  1317. EXT='\.deb'
  1318. PKG=deb
  1319. elif [ "$PKG" = rpm ];then
  1320. PKGCMD='rpm -ihv --nodeps --replacefiles --replacepkgs'
  1321. RMPKGCMD='rpm -e'
  1322. LSPKGCMD='rpm -qa'
  1323. EXT='\.rpm'
  1324. PKG=rpm
  1325. fi
  1326. if [ "$1" = '-f' ] || \
  1327. [ "$1" = '--find' ] || \
  1328. [ "$1" = '--inf-check=1' ] || \
  1329. [ "$1" = '--inf-check=2' ] || \
  1330. [ "$1" = '--inf-check=3' ] || \
  1331. [ "$1" = '--inf-check=4' ] || \
  1332. [ "$1" = '--inf-check=5' ] || \
  1333. [ "$1" = '--inf-check=6' ] || \
  1334. [ "$1" = '-p' ];then
  1335. MODEL_tmp=$(echo $2 | sed s/'-'//g)
  1336. elif [ "$1" = '' ];then
  1337. echo -e -n $COLOR$MESSAGE121 #"Input model name->"
  1338. read modelinput
  1339. echo -e $MONO
  1340. MODEL_tmp=$(echo $modelinput | sed s/'-'//g)
  1341. else
  1342. MODEL_tmp=$(echo $1 | sed s/'-'//g)
  1343. fi
  1344. if [ "$(echo $MODEL_tmp | grep '@')" = '' ];then
  1345. MODEL=$MODEL_tmp
  1346. DEBUG_NOINSTALL='no'
  1347. else
  1348. MODEL=$(echo $MODEL_tmp | tr -d '@')
  1349. DEBUG_NOINSTALL='yes'
  1350. fi
  1351. if [ "$(echo $MODEL_tmp | grep '\[')" = '' ];then
  1352. MODEL=$MODEL_tmp
  1353. NODOWNLOAD=0
  1354. else
  1355. INFPATH="$(echo $MODEL_tmp | tr -d '[' | tr -d ']' )"
  1356. if [ ! -f $INFPATH ];then
  1357. echo -e $COLOR$MESSAGE130$MONO
  1358. exit 0
  1359. fi
  1360. MODEL=$(echo $MODEL_tmp | tr -d '[' | tr -d ']' | sed -e s/"^.*\/"//g)
  1361. NODOWNLOAD=1
  1362. fi
  1363. LPRFILE=""
  1364. CUPSFILE=""
  1365. PDRVFILE=""
  1366. SCANFILE=""
  1367. SKEYFILE=""
  1368. wkdir=/tmp/brprinter-installer
  1369. packdir=brother_driver_packdir
  1370. basedir=$(pwd)
  1371. modelnhuc=""
  1372. mkdir -p $wkdir
  1373. REGION2=$REGION
  1374. if [ -s "$(echo $1 | grep -e .${PKG})" ] && \
  1375. [ -s "$(echo $2 | grep -e .${PKG})" ] && \
  1376. [ -s "$(echo $1 | grep -e 'lp' -e 'cups')" ] && \
  1377. [ -s "$(echo $2 | grep -e 'lp' -e 'cups')" ] && \
  1378. [ -f $1 ] && \
  1379. [ -f $2 ] ; then
  1380. #install local files
  1381. tmpcup=$(echo $1 | grep cups)
  1382. tmplpr=$(echo $2 | grep lp)
  1383. if [ "$tmpcup" = '' ] || [ "$tmplpr" = '' ];then
  1384. tmpcup=$(echo $2 | grep cups)
  1385. tmplpr=$(echo $1 | grep lp)
  1386. fi
  1387. if [ "$tmpcup" = '' ] || [ "$tmplpr" = '' ];then
  1388. echo -e $COLOR$MESSAGE130$MONO #"Install packages does not be found."
  1389. exit 0
  1390. fi
  1391. echo [UNKNOWN] > $wkdir/LOCAL
  1392. echo PRN_CUP_RPM=$tmpcup >> $wkdir/LOCAL
  1393. echo PRN_CUP_DEB=$tmpcup >> $wkdir/LOCAL
  1394. echo PRN_LPD_RPM=$tmplpr >> $wkdir/LOCAL
  1395. echo PRN_LPD_DEB=$tmplpr >> $wkdir/LOCAL
  1396. echo PRN_DRV_RPM=$tmplpr >> $wkdir/LOCAL
  1397. echo PRN_DRV_DEB=$tmplpr >> $wkdir/LOCAL
  1398. echo PRINTERNAME=UNKNOWN >> $wkdir/LOCAL
  1399. echo SCANNER_DRV= >> $wkdir/LOCAL
  1400. echo SCANKEY_DRV= >> $wkdir/LOCAL
  1401. MODEL=LOCAL
  1402. NODOWNLOAD=2
  1403. fi
  1404. # network check
  1405. netaccess=FALSE
  1406. network_check HL5470DW
  1407. if [ $netaccess != SUCCESS ];then
  1408. network_check MFCJ6710CDW
  1409. fi
  1410. if [ $netaccess != SUCCESS ];then
  1411. echo -e -n $COLOR$MESSAGE070 #"Will you specify the PROXY server\? [y/N] ->"
  1412. read answer
  1413. if [ "$answer" = Y ] || [ "$answer" = y ]; then
  1414. #"enter PROXY server URL "
  1415. #" ex http://\(proxy-server-url\):\(port\)"
  1416. #" ex http://\(login-name\):\(pass-word\)@\(proxy-server-url\):\(port\)"
  1417. #" ->"
  1418. echo -e $COLOR$MESSAGE080
  1419. echo -e $COLOR$MESSAGE090
  1420. echo -e $COLOR$MESSAGE100
  1421. echo -e -n $COLOR$MESSAGE110
  1422. read proxy
  1423. echo -e $MONO
  1424. export http_proxy=$proxy
  1425. network_check HL5470DW
  1426. if [ $netaccess != SUCCESS ];then
  1427. network_check MFCJ6710CDW
  1428. fi
  1429. if [ $netaccess != SUCCESS ];then
  1430. echo -e $COLOR$MESSAGE120$MONO
  1431. exit 0
  1432. fi
  1433. else
  1434. echo -e $COLOR$MESSAGE120$MONO
  1435. exit 0
  1436. fi
  1437. fi
  1438. set_host_info $REGION
  1439. get_inf_file $MODEL $wkdir
  1440. if [ $REGION = JPN ];then
  1441. if [ ! -f ${wkdir}/${modelnhuc} ] || [ "${modelnhuc}" = '' ];then
  1442. REGION=US
  1443. modelnhuc=''
  1444. set_host_info $REGION
  1445. get_inf_file $MODEL $wkdir
  1446. REGION=JPN
  1447. fi
  1448. fi
  1449. if [ $infcheck = 0 ];then
  1450. if [ ! -f ${wkdir}/${modelnhuc} ] || [ "${modelnhuc}" = '' ];then
  1451. netaccess=FALSE
  1452. network_check HL5470DW
  1453. if [ $netaccess != SUCCESS ];then
  1454. network_check MFCJ6710CDW
  1455. fi
  1456. if [ $netaccess = SUCCESS ];then
  1457. echo -e $COLOR$MESSAGE130$MONO #"Install packages does not be found."
  1458. echo -e $COLOR$MESSAGE140$MONO #" Confirm the model name."
  1459. echo -e $MONO
  1460. exit 0
  1461. fi
  1462. echo -e -n $COLOR$MESSAGE070 #"Will you specify the PROXY server\? [y/N] ->"
  1463. read answer
  1464. if [ "$answer" = Y ] || [ "$answer" = y ]; then
  1465. #"enter PROXY server URL "
  1466. #" ex http://\(proxy-server-url\):\(port\)"
  1467. #" ex http://\(login-name\):\(pass-word\)@\(proxy-server-url\):\(port\)"
  1468. #" ->"
  1469. echo -e $COLOR$MESSAGE080
  1470. echo -e $COLOR$MESSAGE090
  1471. echo -e $COLOR$MESSAGE100
  1472. echo -e -n $COLOR$MESSAGE110
  1473. read proxy
  1474. echo -e $MONO
  1475. export http_proxy=$proxy
  1476. else
  1477. echo -e $MONO
  1478. #DBG_MSG "exit 10"
  1479. exit 0
  1480. fi
  1481. echo -e $MONO
  1482. REGION=$REGION2
  1483. set_host_info $REGION
  1484. get_inf_file $MODEL $wkdir
  1485. if [ $REGION = JPN ];then
  1486. if [ ! -f ${wkdir}/${modelnhuc} ] || [ "${modelnhuc}" = '' ];then
  1487. REGION=US
  1488. modelnhuc=''
  1489. set_host_info $REGION
  1490. get_inf_file $MODEL $wkdir
  1491. fi
  1492. REGION=JPN
  1493. fi
  1494. fi
  1495. fi
  1496. if [ ! -f ${wkdir}/${modelnhuc} ] || [ "${modelnhuc}" = '' ];then
  1497. #"Cannot get server information. Confirm the network."
  1498. if [ $infcheck = 0 ];then
  1499. echo -e $COLOR$MESSAGE120$MONO
  1500. exit 0
  1501. fi
  1502. if [ $package_list = TEXT ];then
  1503. echo "PACKAGE:PRNL="$LPRFILE
  1504. echo "PACKAGE:PRNC="$CUPSFILE
  1505. echo "PACKAGE:PDRV="$PDRVFILE
  1506. echo "PACKAGE:SCAN="$SCANFILE
  1507. echo "PACKAGE:SKEY="$SKEYFILE
  1508. exit 0
  1509. fi
  1510. if [ $package_list = CSV ];then
  1511. echo "$2"":,"$PKG",${dlresult},${lnk_flag}"\
  1512. ,$LPRFILE,$CUPSFILE,$PDRVFILE,$SCANFILE,$SKEYFILE
  1513. exit 0
  1514. fi
  1515. touch brother-drivers/"$0".log
  1516. dlresult="FALSE "
  1517. lnk_flag=" "
  1518. rccups=" "
  1519. rclpr=" "
  1520. rcscan=" "
  1521. rcskey=" "
  1522. if [ "$infcheck" = 3 ];then
  1523. echo "$2"":,"$PKG",${dlresult},${lnk_flag}","$SCANNER_DRV"\
  1524. ,$rccups,$rclpr,$rcscan,$rcskey\
  1525. >> brother-drivers/"$0".log
  1526. rm -fR brother-drivers/$2 2> /dev/null
  1527. fi
  1528. if [ "$infcheck" = 4 ] || [ "$infcheck" = 5 ];then
  1529. echo "$2"":,"$PKG",${dlresult},${lnk_flag}","$SCANNER_DRV"\
  1530. ,$rccups,$rclpr,$rcscan,$rcskey\
  1531. ,$LPRFILE,$CUPSFILE,$PDRVFILE,$SCANFILE,$SKEYFILE \
  1532. >> brother-drivers/"$0".log
  1533. fi
  1534. exit 0
  1535. fi
  1536. arch=$(uname -m | grep "amd64")
  1537. if [ "$arch" = '' ];then
  1538. arch=$(uname -m | grep "x86_64")
  1539. fi
  1540. if [ "$arch" = '' ];then
  1541. arch=i386
  1542. fi
  1543. if [ "$BROTHER_INSRALLER_FAKE_ARC" != '' ];then
  1544. arch=$BROTHER_INSRALLER_FAKE_ARC
  1545. fi
  1546. get_packages_name ${modelnhuc}
  1547. if [ -f ${wkdir}/${modelnhuc} ];then
  1548. rm -f ${wkdir}/${modelnhuc} 2> /dev/null
  1549. fi
  1550. if [ $infcheck = 1 ];then
  1551. echo "PACKAGE:PRNL="$LPRFILE
  1552. echo "PACKAGE:PRNC="$CUPSFILE
  1553. echo "PACKAGE:PDRV="$PDRVFILE
  1554. echo "PACKAGE:SCAN="$SCANFILE
  1555. echo "PACKAGE:SKEY="$SKEYFILE
  1556. exit 0
  1557. fi
  1558. if [ $infcheck = 2 ];then
  1559. echo "$2"":,"$PKG",${dlresult},${lnk_flag}"\
  1560. ,$LPRFILE,$CUPSFILE,$PDRVFILE,$SCANFILE,$SKEYFILE
  1561. exit 0
  1562. fi
  1563. if [ "$infcheck" -ge 3 ];then
  1564. rccups='N/A '
  1565. rclpr='N/A '
  1566. rcscan='N/A '
  1567. rcskey='N/A '
  1568. dwkdir=brother-drivers/$2
  1569. mkdir -p $dwkdir
  1570. if [ "$CUPSFILE" != '' ];then
  1571. rccups="FALSE "
  1572. wget $WGET_OP '-nc' $URL_PKG/$CUPSFILE -P $dwkdir
  1573. fi
  1574. if [ "$LPRFILE" != '' ];then
  1575. rclpr="FALSE "
  1576. wget $WGET_OP '-nc' $URL_PKG/$LPRFILE -P $dwkdir
  1577. fi
  1578. if [ "$PDRVFILE" != '' ];then
  1579. rcpdrv="FALSE "
  1580. wget $WGET_OP '-nc' $URL_PKG/$PDRVFILE -P $dwkdir
  1581. fi
  1582. if [ "$SCANFILE" != '' ];then
  1583. rcscan="FALSE "
  1584. wget $WGET_OP '-nc' $URL_PKG/$SCANFILE -P $dwkdir
  1585. fi
  1586. if [ "$SKEYFILE" != '' ];then
  1587. rcskey="FALSE "
  1588. wget $WGET_OP '-nc' $URL_PKG/$SKEYFILE -P $dwkdir
  1589. fi
  1590. # -------------
  1591. if [ "$CUPSFILE" != '' ];then
  1592. if [ -f $dwkdir/$CUPSFILE ];then
  1593. rccups=SUCCESS
  1594. fi
  1595. fi
  1596. if [ "$LPRFILE" != '' ];then
  1597. if [ -f $dwkdir/$LPRFILE ];then
  1598. rclpr=SUCCESS
  1599. fi
  1600. fi
  1601. if [ "$PDRVFILE" != '' ];then
  1602. if [ -f $dwkdir/$PDRVFILE ];then
  1603. rcpdrv=SUCCESS
  1604. fi
  1605. fi
  1606. if [ "$SCANFILE" != '' ];then
  1607. if [ -f $dwkdir/$SCANFILE ];then
  1608. rcscan=SUCCESS
  1609. fi
  1610. fi
  1611. if [ "$SKEYFILE" != '' ];then
  1612. if [ -f $dwkdir/$SKEYFILE ];then
  1613. rcskey=SUCCESS
  1614. fi
  1615. fi
  1616. # -------------
  1617. touch brother-drivers/"$0".log
  1618. if [ "$infcheck" = 3 ];then
  1619. echo "$2"":,${modelnhuc},"$PKG",${dlresult},${lnk_flag}","$SCANNER_DRV"\
  1620. ,$rccups,$rclpr,$rcscan,$rcskey\
  1621. >> brother-drivers/"$0".log
  1622. fi
  1623. if [ "$infcheck" = 4 ] || [ "$infcheck" = 5 ];then
  1624. echo "$2"":,${modelnhuc},"$PKG",${dlresult},${lnk_flag}","$SCANNER_DRV"\
  1625. ,$rccups,$rclpr,$rcscan,$rcskey\
  1626. ,$LPRFILE,$CUPSFILE,$PDRVFILE,$SCANFILE,$SKEYFILE \
  1627. >> brother-drivers/"$0".log
  1628. fi
  1629. if [ "$infcheck" = 3 ] || [ "$infcheck" = 4 ];then
  1630. rm -fR brother-drivers/$2 2> /dev/null
  1631. fi
  1632. exit 0
  1633. fi
  1634. if [ "$CUPSFILE" = '' ] && [ "$LPRFILE" = '' ] && [ "$PDRVFILE" = '' ] && [ "$SCAN" = '' ];then
  1635. echo -e $COLOR$MESSAGE130$MONO #"Install packages does not be found."
  1636. echo -e $COLOR$MESSAGE140$MONO #" Confirm the model name."
  1637. post_install_sweep
  1638. if [ "$1" = '' ];then
  1639. echo -e -n $COLOR$MESSAGE240$MONO #"Hit Return/Enter Key"
  1640. read answer
  1641. fi
  1642. #DBG_MSG "exit 12"
  1643. exit 0
  1644. fi
  1645. if [ "$1" = '-f' ] || [ "$1" = '--find' ];then
  1646. echo $LPRFILE
  1647. echo $CUPSFILE
  1648. echo $PDRVFILE
  1649. echo $SCANFILE
  1650. echo $SKEYFILE
  1651. post_install_sweep
  1652. #DBG_MSG "exit 13"
  1653. exit 0
  1654. fi
  1655. PREPKGCMDC=''
  1656. PREPKGCMDL=''
  1657. PREPKGCMDP=''
  1658. if [ "$PKG" = deb ];then
  1659. if [ "$CUPSFILE" != '' ];then
  1660. PREPKGCMDC="dpkg -x $CUPSFILE /"
  1661. fi
  1662. if [ "$PDRVFILE" != '' ];then
  1663. PREPKGCMDP="dpkg -x $PDRVFILE /"
  1664. fi
  1665. if [ "$LPRFILE" != '' ];then
  1666. PREPKGCMDL="dpkg -x $LPRFILE /"
  1667. fi
  1668. fi
  1669. post_install_sweep
  1670. echo -e $COLOR4$MESSAGE150$MONO #"You are going to install following packages."
  1671. if [ "$LPRFILE" != '' ];then
  1672. echo -e $COLOR4" "$LPRFILE$MONO
  1673. fi
  1674. if [ "$CUPSFILE" != '' ];then
  1675. echo -e $COLOR4" "$CUPSFILE$MONO
  1676. fi
  1677. if [ "$PDRVFILE" != '' ];then
  1678. echo -e $COLOR4" "$PDRVFILE$MONO
  1679. fi
  1680. if [ "$SCANFILE" != '' ];then
  1681. echo -e $COLOR4" "$SCANFILE
  1682. fi
  1683. if [ "$SKEYFILE" != '' ];then
  1684. echo -e $COLOR4" "$SKEYFILE
  1685. fi
  1686. echo -e -n $COLOR$MESSAGE160 #"OK\? [y/N] ->"
  1687. read answer
  1688. echo -e $MONO
  1689. if [ "$answer" != Y ] && [ "$answer" != y ]; then
  1690. #scanner_install # scanner
  1691. #DBG_MSG "exit 14"
  1692. exit 0
  1693. fi
  1694. if [ "$LPRFILE" != '' ];then
  1695. if ! [ -f "$LPRFILE" ];then
  1696. brother_license
  1697. echo -e -n $COLOR$MESSAGE170 #"Are you agree\? [Y/n] ->"
  1698. read answer
  1699. echo -e $MONO
  1700. if [ "$answer" = N ] || [ "$answer" = n ]; then
  1701. scanner_install # scanner
  1702. post_proc
  1703. #DBG_MSG "exit 15"
  1704. exit 0
  1705. fi
  1706. if [ "$(which wget 2> /dev/null)" = '' ];then
  1707. echo -e -n $COLOR$MESSAGE280 #"wget is required."
  1708. echo -e $MONO
  1709. #DBG_MSG "exit 16"
  1710. exit 0
  1711. fi
  1712. if [ ! -f $LPRFILE ];then
  1713. rm -f $LPRFILE 2> /dev/null
  1714. echo wget $WGET_OP $CACHEFLG $URL_PKG/$LPRFILE
  1715. wget $WGET_OP $CACHEFLG $URL_PKG/$LPRFILE
  1716. fi
  1717. fi
  1718. fi
  1719. if [ "$CUPSFILE" != '' ];then
  1720. if ! [ -f "$CUPSFILE" ];then
  1721. gpl_license
  1722. echo -e -n $COLOR$MESSAGE180 #"Do you agree\? [Y/n] ->"
  1723. read answer
  1724. echo -e $MONO
  1725. if [ "$answer" = N ] || [ "$answer" = n ]; then
  1726. scanner_install # scanner
  1727. post_proc
  1728. #DBG_MSG "exit 17"
  1729. exit 0
  1730. fi
  1731. if [ "$(which wget 2> /dev/null)" = '' ];then
  1732. echo -e -n $COLOR$MESSAGE280 #"wget is required."
  1733. echo -e $MONO
  1734. #DBG_MSG "exit 18"
  1735. exit 0
  1736. fi
  1737. if [ ! -f $CUPSFILE ];then
  1738. rm -f $CUPSFILE 2> /dev/null
  1739. echo wget $WGET_OP $CACHEFLG $URL_PKG/$CUPSFILE
  1740. wget $WGET_OP $CACHEFLG $URL_PKG/$CUPSFILE
  1741. fi
  1742. fi
  1743. fi
  1744. #--
  1745. if [ "$PDRVFILE" != '' ];then
  1746. if ! [ -f "$PDRVFILE" ];then
  1747. pdrv_complex_license
  1748. echo -e -n $COLOR$MESSAGE180 #"Do you agree\? [Y/n] ->"
  1749. read answer
  1750. echo -e $MONO
  1751. if [ "$answer" = N ] || [ "$answer" = n ]; then
  1752. scanner_install # scanner
  1753. post_proc
  1754. #DBG_MSG "exit 17"
  1755. exit 0
  1756. fi
  1757. if [ "$(which wget 2> /dev/null)" = '' ];then
  1758. echo -e -n $COLOR$MESSAGE280 #"wget is required."
  1759. echo -e $MONO
  1760. #DBG_MSG "exit 18"
  1761. exit 0
  1762. fi
  1763. if [ ! -f $PDRVFILE ];then
  1764. rm -f $PDRVFILE 2> /dev/null
  1765. echo wget $WGET_OP $CACHEFLG $URL_PKG/$PDRVFILE
  1766. wget $WGET_OP $CACHEFLG $URL_PKG/$PDRVFILE
  1767. fi
  1768. fi
  1769. fi
  1770. pre_proc
  1771. require_386lib=no
  1772. if [ "$arch" != 'i386' ];then
  1773. require_386lib=yes
  1774. if [ "$REQ32LIB" = 'NO' ] || \
  1775. [ "$REQ32LIB" = 'No' ] || \
  1776. [ "$REQ32LIB" = 'no' ];then
  1777. require_386lib=no
  1778. fi
  1779. fi
  1780. if [ "$require_386lib" = yes ];then
  1781. if [ "$(which dpkg 2>/dev/null)" != '' ];then
  1782. ia32=$(dpkg -l | grep "ia32-libs")
  1783. lib32=$(dpkg -l | grep "lib32stdc++6")
  1784. if [ "$ia32" = '' ] || [ "$lib32" = '' ];then
  1785. apt-get update
  1786. fi
  1787. if [ "$ia32" = '' ];then
  1788. apt-get install ia32-libs
  1789. fi
  1790. lib32=$(dpkg -l | grep "lib32stdc++6")
  1791. if [ "$lib32" = '' ];then
  1792. apt-get install lib32stdc++6
  1793. fi
  1794. fi
  1795. #----------- check Fedor,CentOS,RedHat 64 --------------
  1796. if [ -e /etc/fedora-release ] || [ -e /etc/fedora ] || \
  1797. [ -e /etc/centos-release ] || [ -e /etc/centos ] || \
  1798. [ -e /etc/redhat-release ] || [ -e /etc/redhat ]; then
  1799. lib32=$(rpm -qa| grep glibc | grep i686)
  1800. if [ "$lib32" = "" ];then
  1801. if [ "$(which yum 2>/dev/null)" != '' ];then
  1802. echo yum install glibc.i686
  1803. yum install glibc.i686
  1804. echo yum install libstdc++.i686
  1805. yum install libstdc++.i686
  1806. else
  1807. echo dnf install glibc.i686
  1808. dnf install glibc.i686
  1809. echo dnf install libstdc++.i686
  1810. dnf install libstdc++.i686
  1811. fi
  1812. fi
  1813. fi
  1814. fi
  1815. DUMMYCUPSYS=0
  1816. DUMMYCUPS=0
  1817. DUMMYLPD=0
  1818. DUMMYLPRNG=0
  1819. if ! [ -f /etc/init.d/cupsys ];then
  1820. DUMMYCUPSYS=1
  1821. ln -s /bin/true /etc/init.d/cupsys
  1822. fi
  1823. if ! [ -f /etc/init.d/cups ];then
  1824. DUMMYCUPS=1
  1825. ln -s /bin/true /etc/init.d/cups
  1826. fi
  1827. if ! [ -f /etc/init.d/lpd ];then
  1828. DUMMYLPD=1
  1829. ln -s /bin/true /etc/init.d/lpd
  1830. fi
  1831. if ! [ -f /etc/init.d/lprng ];then
  1832. DUMMYLPRNG=1
  1833. ln -s /bin/true /etc/init.d/lprng
  1834. fi
  1835. LPADMIN=lpadmin
  1836. LPINFO=lpinfo
  1837. if ! [ "$(which $LPADMIN 2> /dev/null)" ];then
  1838. LPADMIN=/usr/sbin/lpadmin
  1839. fi
  1840. if ! [ "$(which $LPINFO 2> /dev/null)" ];then
  1841. LPINFO=/usr/sbin/lpinfo
  1842. fi
  1843. mkmodeldir=0
  1844. if [ ! -d /usr/share/cups/model ];then
  1845. mkdir -p /usr/share/cups/model
  1846. mkmodeldir=1
  1847. fi
  1848. if [ "$PREPKGCMDL" != '' ];then
  1849. echo $PREPKGCMDL
  1850. $PREPKGCMDL
  1851. fi
  1852. if [ "$PREPKGCMDC" != '' ];then
  1853. echo $PREPKGCMDC
  1854. $PREPKGCMDC
  1855. fi
  1856. if [ "$PREPKGCMDP" != '' ];then
  1857. echo $PREPKGCMDP
  1858. $PREPKGCMDP
  1859. fi
  1860. if [ "$PKG" = deb ];then
  1861. cleanup_deb_cups_pkg
  1862. # for Ubuntu 11.04
  1863. debfile=$(echo $LPRFILE | sed s/\.i386.deb/a\.i386.deb/g)
  1864. mkdir -p $wkdir/$packdir
  1865. if [ "$LPRFILE" != '' ];then
  1866. cp $basedir/$LPRFILE $wkdir/$packdir
  1867. cd $wkdir/$packdir
  1868. dpkg-deb -e $LPRFILE DEBIAN
  1869. dpkg -x $LPRFILE ./
  1870. cat DEBIAN/control \
  1871. | sed s/Depends.*$//g \
  1872. | tr -s '\n' \
  1873. > DEBIAN/control.tmp
  1874. mv -f DEBIAN/control.tmp DEBIAN/control
  1875. rm -f $LPRFILE 2> /dev/null
  1876. rm -fR usr/share/doc/* 2> /dev/null
  1877. LPRFILE=$debfile
  1878. cd $wkdir
  1879. dpkg -b ./$packdir $debfile
  1880. echo dpkg -b ./$packdir $debfile
  1881. rm -fR $wkdir/$packdir/* 2> /dev/null
  1882. fi
  1883. if [ "$CUPSFILE" != '' ];then
  1884. debfile=$(echo $CUPSFILE | sed s/\.i386.deb/a\.i386.deb/g)
  1885. cp $basedir/$CUPSFILE $wkdir/$packdir
  1886. cd $wkdir/$packdir
  1887. dpkg-deb -e $CUPSFILE DEBIAN
  1888. dpkg -x $CUPSFILE ./
  1889. cat DEBIAN/control \
  1890. | sed s/Depends.*$//g \
  1891. | tr -s '\n' \
  1892. > DEBIAN/control.tmp
  1893. mv -f DEBIAN/control.tmp DEBIAN/control
  1894. rm -f $CUPSFILE 2> /dev/null
  1895. rm -fR usr/share/doc/* 2> /dev/null
  1896. cd $wkdir
  1897. dpkg -b ./$packdir $debfile
  1898. echo dpkg -b ./$packdir $debfile
  1899. CUPSFILE=$debfile
  1900. rm -fR $wkdir/$packdir 2> /dev/null
  1901. fi
  1902. if [ "$PDRVFILE" != '' ];then
  1903. debfile=$(echo $PDRVFILE | sed s/\.i386.deb/a\.i386.deb/g)
  1904. cp $basedir/$PDRVFILE $wkdir/$packdir
  1905. cd $wkdir/$packdir
  1906. dpkg-deb -e $PDRVFILE DEBIAN
  1907. dpkg -x $PDRVFILE ./
  1908. cat DEBIAN/control \
  1909. | sed s/Depends.*$//g \
  1910. | tr -s '\n' \
  1911. > DEBIAN/control.tmp
  1912. mv -f DEBIAN/control.tmp DEBIAN/control
  1913. rm -f $PDRVFILE 2> /dev/null
  1914. rm -fR usr/share/doc/* 2> /dev/null
  1915. cd $wkdir
  1916. dpkg -b ./$packdir $debfile
  1917. echo dpkg -b ./$packdir $debfile
  1918. PDRVFILE=$debfile
  1919. rm -fR $wkdir/$packdir 2> /dev/null
  1920. fi
  1921. if [ "$CUPSFILE" != '' ];then
  1922. mv $wkdir/$CUPSFILE $basedir
  1923. fi
  1924. if [ "$LPRFILE" != '' ];then
  1925. mv $wkdir/$LPRFILE $basedir
  1926. fi
  1927. if [ "$PDRVFILE" != '' ];then
  1928. mv $wkdir/$PDRVFILE $basedir
  1929. fi
  1930. fi
  1931. cd $basedir
  1932. if [ "$DEBUG_NOINSTALL" != 'yes' ];then
  1933. if [ "$LPRFILE" != '' ];then
  1934. echo -n -e $COLOR4
  1935. echo $PKGCMD $LPRFILE
  1936. echo -n -e $MONO
  1937. $PKGCMD $LPRFILE
  1938. fi
  1939. if [ "$CUPSFILE" != '' ];then
  1940. echo -n -e $COLOR4
  1941. echo $PKGCMD $CUPSFILE
  1942. echo -n -e $MONO
  1943. $PKGCMD $CUPSFILE | tee /tmp/brother_linux_brprinter_installer.tmp
  1944. echo -n -e $MONO
  1945. fi
  1946. if [ "$PDRVFILE" != '' ];then
  1947. echo -n -e $COLOR4
  1948. echo $PKGCMD $PDRVFILE
  1949. echo -n -e $MONO
  1950. $PKGCMD $PDRVFILE | tee /tmp/brother_linux_brprinter_installer.tmp
  1951. echo -n -e $MONO
  1952. fi
  1953. else
  1954. echo -n -e $COLOR4
  1955. if [ "$LPRFILE" != '' ];then
  1956. echo $PKGCMD $LPRFILE
  1957. fi
  1958. sleep 1
  1959. if [ "$CUPSFILE" != '' ];then
  1960. echo $PKGCMD $CUPSFILE
  1961. fi
  1962. sleep 1
  1963. if [ "$PDRVFILE" != '' ];then
  1964. echo $PKGCMD $PDRVFILE
  1965. fi
  1966. echo -n -e $MONO
  1967. fi
  1968. install_done=yes
  1969. #if [ "$PKG" = deb ];then
  1970. # rm -f $LPRFILE 2> /dev/null
  1971. # rm -f $CUPSFILE 2> /dev/null
  1972. #fi
  1973. if [ -f /tmp/brother_linux_brprinter_installer.tmp ];then
  1974. csherr=$(cat /tmp/brother_linux_brprinter_installer.tmp | \
  1975. grep 'ERROR: csh is required')
  1976. if [ "$csherr" != "" ];then
  1977. echo -e -n $COLOR
  1978. echo $MESSAGE250
  1979. echo -e $MONO
  1980. #DBG_MSG "exit 19"
  1981. exit 0
  1982. fi
  1983. fi
  1984. #wait for installation end
  1985. RAWINSTALLED=yes
  1986. if [ "$PRINTERNAME" != UNKNOWN ];then
  1987. retry='0'
  1988. if [ "$DEBUG_NOINSTALL" != 'yes' ];then
  1989. while [ ! -f /etc/cups/ppd/"$PRINTERNAME".ppd ] && [ "$retry" -le $TIMEOUT ] ;do
  1990. sleep 1
  1991. retry=$(($retry+1))
  1992. echo -n \#
  1993. done
  1994. if [ -f /etc/cups/ppd/"$PRINTERNAME".ppd ];then
  1995. RAWINSTALLED=no
  1996. fi
  1997. else
  1998. sleep 1
  1999. fi
  2000. else
  2001. retry='0'
  2002. if [ "$DEBUG_NOINSTALL" != 'yes' ];then
  2003. while [ $retry -le $TIMEOUT ] ;do
  2004. sleep 1
  2005. for ppd in $(ls /etc/cups/ppd/*.ppd)
  2006. do
  2007. modelname=$(echo $ppd | sed s/\.ppd//g | sed s/"\/etc\/cups\/"//g)
  2008. modelname2=$(echo $modelname | tr -d '-' | tr "[A-Z]" "[a-z]")
  2009. file=$(echo $CUPSFILE | tr -d '-' | tr "[A-Z]" "[a-z]")
  2010. if [ "$(echo $file | grep $modelname2)" != '' ];then
  2011. retry=512
  2012. PRINTERNAME=$(echo $modelname | tr "[a-z]" "[A-Z]")
  2013. RAWINSTALLED=no
  2014. echo PRINTERNAME=$modelname
  2015. break
  2016. fi
  2017. done
  2018. retry=$(($retry+1))
  2019. echo -n \#
  2020. done
  2021. if [ "$PRINTERNAME" = UNKNOWN ];then
  2022. PRINTERNAME=$(echo $CUPSFILE | \
  2023. sed s/"^br"//g | \
  2024. sed s/"^cupswrapper"//g | \
  2025. sed s/"cupswrapper-.*$"//g | \
  2026. sed s/"cupswrapperinch-.*$"//g | \
  2027. sed s/"cups-.*$"//g | \
  2028. sed s/"-.*$"//g | \
  2029. sed s/"_.*$"//g | \
  2030. tr "[a-z]" "[A-Z]")
  2031. fi
  2032. else
  2033. sleep 1
  2034. fi
  2035. fi
  2036. PPDOPT=''
  2037. if [ "$RAWINSTALLED" = 'yes' ];then
  2038. for ppd in $(ls /usr/share/ppd/*.ppd /usr/share/cups/model/*.ppd)
  2039. do
  2040. ppd2=$(echo $ppd | tr -d '-')
  2041. prnname=$(echo $PRINTERNAME | tr -d '-')
  2042. if [ "$(echo $ppd2 | grep -i $prnname)" != '' ];then
  2043. PPDOPT="-P $ppd"
  2044. break
  2045. fi
  2046. done
  2047. fi
  2048. echo \#
  2049. #------------
  2050. if [ "$DUMMYCUPS" = 1 ];then
  2051. if [ "$(ls -al /etc/init.d/cups 2> /dev/null | grep ^l )" != '' ];then
  2052. rm -f /etc/init.d/cups 2> /dev/null
  2053. fi
  2054. fi
  2055. if [ "$DUMMYCUPSYS" = 1 ];then
  2056. if [ "$(ls -al /etc/init.d/cupsys 2> /dev/null | grep ^l )" != '' ];then
  2057. rm -f /etc/init.d/cupsys 2> /dev/null
  2058. fi
  2059. fi
  2060. if [ "$DUMMYLPD" = 1 ];then
  2061. if [ "$(ls -al /etc/init.d/lpd 2> /dev/null | grep ^l )" != '' ];then
  2062. rm -f /etc/init.d/lpd 2> /dev/null
  2063. fi
  2064. fi
  2065. if [ "$DUMMYLPRNG" = 1 ];then
  2066. if [ "$(ls -al /etc/init.d/lprng 2> /dev/null | grep ^l )" != '' ];then
  2067. rm -f /etc/init.d/lprng 2> /dev/null
  2068. fi
  2069. fi
  2070. #------------
  2071. # for SuSE 64
  2072. if [ "$arch" != "i386" ];then
  2073. if [ -d "$LIB64FLT" ] && [ -d "$LIBFLT" ] ;then
  2074. filter=$(ls $LIBFLT 2> /dev/null | grep -i $PRINTERNAME | head -n 1 )
  2075. filter64=$(ls $LIB64FLT 2> /dev/null | grep -i $PRINTERNAME | head -n 1 )
  2076. if [ "$filter" != '' ] && [ "$filter64" = '' ];then
  2077. echo cp "$LIBFLT"/$filter "$LIB64FLT"
  2078. cp "$LIBFLT"/$filter "$LIB64FLT"
  2079. echo -n -e $COLOR4
  2080. echo $LPADMIN -p $PRINTERNAME -E $PPDOPT
  2081. echo -n -e $MONO
  2082. $LPADMIN -p $PRINTERNAME -E $PPDOPT
  2083. rm64filter="rm -f $LIB64FLT/$filter"
  2084. fi
  2085. fi
  2086. if [ -d "$LIB32FLT" ]&& [ -d "$LIBFLT" ] ;then
  2087. filter=$(ls $LIBFLT 2> /dev/null | grep -i $PRINTERNAME | head -n 1 )
  2088. filter32=$(ls $LIB32FLT 2> /dev/null| grep -i $PRINTERNAME | head -n 1 )
  2089. if [ "$filter" != '' ] && [ "$filter64" = '' ];then
  2090. echo cp "$LIBFLT"/$filter "$LIB32FLT"
  2091. cp "$LIBFLT"/$filter "$LIB32FLT"
  2092. echo -n -e $COLOR4
  2093. echo $LPADMIN -p $PRINTERNAME -E $PPDOPT
  2094. echo -n -e $MONO
  2095. $LPADMIN -p $PRINTERNAME -E $PPDOPT
  2096. rm32filter="rm -f $LIB64FLT/$filter"
  2097. fi
  2098. fi
  2099. fi
  2100. ## /usr/lib32
  2101. LPRPKGNAME=$(echo $LPRFILE |\
  2102. sed s/"_.*$"//g |\
  2103. sed s/"-.*$"//g)
  2104. pkgpostfix=''
  2105. if [ "$PKG" = deb ];then
  2106. if [ "${LPRPKGNAME}" != '' ];then
  2107. if [ "$(dpkg -l | grep ${LPRPKGNAME}:i386)" != '' ];then
  2108. pkgpostfix=':i386'
  2109. fi
  2110. files=$(dpkg -L "$LPRPKGNAME""$pkgpostfix" | grep '/usr/lib/')
  2111. else
  2112. files=""
  2113. fi
  2114. fi
  2115. if [ "$PKG" = rpm ];then
  2116. if [ "${LPRPKGNAME}" != '' ];then
  2117. files=$(rpm -q --filesbypkg $LPRPKGNAME | \
  2118. grep '/usr/lib/' | \
  2119. sed s/"$LPRPKGNAME"//g | \
  2120. sed s/' '//g)
  2121. else
  2122. files=""
  2123. fi
  2124. fi
  2125. #--------------------------------
  2126. # make uninstall script
  2127. DBG_MSG "make uninstaller script for printer : uninstaller_${PRINTERNAME}"
  2128. uninstaller_prn=uninstaller_${PRINTERNAME}
  2129. rm -f $uninstaller_prn 2> /dev/null
  2130. echo "#! /bin/bash" > $uninstaller_prn
  2131. echo "#RM_SELINUX_RULE=enable" >>$uninstaller_prn
  2132. echo "#" >>$uninstaller_prn
  2133. echo "# PRNL=$LPRFILE" >>$uninstaller_prn
  2134. echo "# PRNC=$CUPSFILE" >>$uninstaller_prn
  2135. echo "# PRNP=$PDRVFILE" >>$uninstaller_prn
  2136. echo "# SCAN=$SCANFILE" >>$uninstaller_prn
  2137. echo "# SKEY=$SKEYFILE" >>$uninstaller_prn
  2138. echo "#" >>$uninstaller_prn
  2139. for pathlib in $files
  2140. do
  2141. pathlib32lib=$(echo $pathlib | \
  2142. sed s/'\/usr\/lib\/'/'\/usr\/lib32\/'/g)
  2143. if [ -d '/usr/lib32' ];then
  2144. if [ ! -f "$pathlib32lib" ]; then
  2145. if [ "$pathlib" != '' ] && [ "$pathlib32lib" != '' ];then
  2146. echo ln -s $pathlib $pathlib32lib
  2147. ln -s $pathlib $pathlib32lib
  2148. echo "rm -f $pathlib32lib" >> $uninstaller_prn
  2149. fi
  2150. fi
  2151. fi
  2152. done
  2153. ## /usr/lib32 symlink
  2154. if [ "$files" != '' ];then
  2155. for pathlib in $(ls $(echo "$files"|sed -e s/.so.*$/\*/g))
  2156. do
  2157. if [ -d '/usr/lib32' ];then
  2158. #echo pathlib32lib=$(echo $pathlib | sed -e s/"usr\/lib"/"usr\/lib32"/)
  2159. pathlib32lib=$(echo $pathlib | sed -e s/"usr\/lib"/"usr\/lib32"/)
  2160. if [ ! -f "$pathlib32lib" ]; then
  2161. if [ "$pathlib" != '' ] && [ "$pathlib32lib" != '' ];then
  2162. echo ln -s $pathlib $pathlib32lib
  2163. ln -s $pathlib $pathlib32lib
  2164. echo "rm -f $pathlib32lib" >> $uninstaller_prn
  2165. fi
  2166. fi
  2167. fi
  2168. done
  2169. fi
  2170. ## /lib/lib32 symlink
  2171. # AppArmor
  2172. if [ "$(which aa-complain 2> /dev/null)" != '' ];then
  2173. echo -e $COLOR$MESSAGE184$MONO #"AppArmor"
  2174. echo aa-complain cupsd
  2175. aa-complain cupsd
  2176. fi
  2177. # for SELinux
  2178. if [ "$(which semanage 2> /dev/null)" = '' ];then
  2179. if [ "$(which yum 2>/dev/null)" != '' ];then
  2180. echo yum install policycoreutils-python
  2181. yum install policycoreutils-python
  2182. echo yum install policycoreutils
  2183. yum install policycoreutils
  2184. elif [ "$(which dnf 2>/dev/null)" != '' ];then
  2185. echo dnf install policycoreutils-python
  2186. dnf install policycoreutils-python
  2187. echo dnf install policycoreutils
  2188. dnf install policycoreutils
  2189. fi
  2190. fi
  2191. if [ "$(which semanage 2> /dev/null)" = '' ];then
  2192. if [ "$(which yum 2>/dev/null)" != '' ];then
  2193. echo yum install policycoreutils-python-utils
  2194. yum install policycoreutils-python-utils
  2195. elif [ "$(which dnf 2>/dev/null)" != '' ];then
  2196. echo dnf install policycoreutils-python-utils
  2197. dnf install policycoreutils-python-utils
  2198. fi
  2199. fi
  2200. if [ "$(which semanage 2> /dev/null)" != '' ];then
  2201. echo \if [ \"\$RM_SELINUX_RULE\" = \"enable\" ]\;then >> $uninstaller_prn
  2202. while read rule
  2203. do
  2204. if [ "$rule" != '' ];then
  2205. sedir=$(echo $rule | \
  2206. sed s/"^.*'\/"/"\/"/g | \
  2207. sed s/"\/(.*$"//g |\
  2208. sed s/"(.*$"//g |\
  2209. sed s/"'"//g)
  2210. rule2=$(echo $rule | sed s/"'"/""/g)
  2211. rule3=$(echo $rule | sed s/"("/"\("/g | sed s/")"/"\)"/g)
  2212. if [ -d $sedir ]; then
  2213. echo semanage fcontext -a -t $rule2
  2214. semanage fcontext -a -t $rule2
  2215. echo " "echo semanage fcontext -d -t $rule3 >> $uninstaller_prn
  2216. echo " "semanage fcontext -d -t $rule3 >> $uninstaller_prn
  2217. echo restorecon -R $sedir
  2218. restorecon -R $sedir
  2219. echo " "echo restorecon -R $sedir >> $uninstaller_prn
  2220. echo " "restorecon -R $sedir >> $uninstaller_prn
  2221. fi
  2222. fi
  2223. done << %%selinux_rules%%
  2224. cupsd_rw_etc_t '/usr/local/Brother/Printer/(.*/)?inf(/.*)?'
  2225. bin_t '/usr/local/Brother/Printer/(.*/)?inf/brprintconf(.*)?'
  2226. bin_t '/usr/local/Brother/Printer/(.*/)?lpd(/.*)?'
  2227. bin_t '/usr/local/Brother/Printer/(.*/)?cupswrapper(/.*)?'
  2228. bin_t '/usr/local/Brother'
  2229. cupsd_rw_etc_t '/usr/local/Brother/inf(/.*)?'
  2230. bin_t '/usr/local/Brother/lpd(/.*)?'
  2231. bin_t '/usr/local/Brother/cupswrapper(/.*)?'
  2232. bin_t '/opt/brother'
  2233. cupsd_rw_etc_t '/etc/opt/brother'
  2234. cupsd_rw_etc_t '/opt/brother/Printers/(.*/)?inf(/.*)?'
  2235. cupsd_rw_etc_t '/etc/opt/brother/Printers/(.*/)?inf(/.*)?'
  2236. bin_t '/opt/brother/Printers/(.*/)?lpd(/.*)?'
  2237. bin_t '/opt/brother/Printers/(.*/)?cupswrapper(/.*)?'
  2238. %%selinux_rules%%
  2239. if [ -e $LIBFLT ] ;then
  2240. echo restorecon -RFv $LIBFLT
  2241. restorecon -RFv $LIBFLT
  2242. fi
  2243. if [ -e $LIB32FLT ] ;then
  2244. echo restorecon -RFv $LIB32FLT
  2245. restorecon -RFv $LIB32FLT
  2246. fi
  2247. if [ -e $LIB64FLT ] ;then
  2248. echo restorecon -RFv $LIB64FLT
  2249. restorecon -RFv $LIB64FLT
  2250. fi
  2251. echo setsebool -P cups_execmem 1
  2252. setsebool -P cups_execmem 1
  2253. echo " echo setsebool -P cups_execmem 0" >> $uninstaller_prn
  2254. echo " setsebool -P cups_execmem 0" >> $uninstaller_prn
  2255. echo fi >> $uninstaller_prn
  2256. fi
  2257. #if [ "$(which setenforce 2> /dev/null)" != '' ];then
  2258. # echo -e $COLOR$MESSAGE182$MONO #"SELinux"
  2259. # echo setenforce 0
  2260. # setenforce 0
  2261. #fi
  2262. ## Configure Device URI
  2263. if [ "$RAWINSTALLED" = no ];then
  2264. echo -e -n $COLOR$MESSAGE190 #"Will you specify the Device URI\? [y/N] ->"
  2265. read answer
  2266. echo -e $MONO
  2267. else
  2268. answer=Y
  2269. fi
  2270. if [ "$answer" != n ] && [ "$answer" != N ]; then
  2271. duri=$($LPINFO -v | sed s/'^.* '//g | \
  2272. grep -v 'brserial_' | grep -v 'brusb_')
  2273. i=0
  2274. echo -e $COLOR4
  2275. autodurin=""
  2276. for deviceuri in $duri
  2277. do
  2278. prnn2=$(echo $PRINTERNAME | tr -d '-' | tr "[A-Z]" "[a-z]")
  2279. duri2=$(echo $deviceuri | tr -d '-' | tr "[A-Z]" "[a-z]")
  2280. if [ "$(echo $duri2 | grep 'usb://brother' |grep $prnn2 2>/dev/null )" \
  2281. != '' ];then
  2282. autodurin=$i
  2283. autoduris=$deviceuri
  2284. break
  2285. else
  2286. i=$(($i+1))
  2287. fi
  2288. done
  2289. if [ "$autodurin" = '' ];then
  2290. i=0
  2291. for deviceuri in $duri
  2292. do
  2293. prnn2=$(echo $PRINTERNAME | tr -d '-' | tr "[A-Z]" "[a-z]")
  2294. duri2=$(echo $deviceuri | tr -d '-' | tr "[A-Z]" "[a-z]")
  2295. if [ "$(echo $duri2 | grep $prnn2 2>/dev/null)" != '' ];then
  2296. autodurin=$i
  2297. autoduris=$deviceuri
  2298. break
  2299. else
  2300. i=$(($i+1))
  2301. fi
  2302. done
  2303. fi
  2304. if [ "$autodurin" = '' ];then
  2305. i=0
  2306. for deviceuri in $duri
  2307. do
  2308. prnn2=$(echo $PRINTERNAME | tr -d '-' | tr "[A-Z]" "[a-z]")
  2309. duri2=$(echo $deviceuri | tr -d '-' | tr "[A-Z]" "[a-z]")
  2310. if [ "$(echo $duri2 | grep 'usb://brother' 2>/dev/null)" != '' ];then
  2311. autodurin=$i
  2312. autoduris=$deviceuri
  2313. else
  2314. i=$(($i+1))
  2315. fi
  2316. done
  2317. fi
  2318. if [ "$autoduris" = '' ];then
  2319. autoduris='usb://dev/usblp0'
  2320. fi
  2321. i=0
  2322. for deviceuri in $duri
  2323. do
  2324. echo $i: $deviceuri
  2325. i=$(($i+1))
  2326. done
  2327. echo -e $i "(I)": $MESSAGE200 #"Specify IP address."
  2328. i=$(($i+1))
  2329. echo -e $i "(A)": $MESSAGE201 "("$autoduris")" #"Auto."
  2330. echo -e $MONO
  2331. echo -e -n $COLOR$MESSAGE210 #"select the number of distination Device URI. ->"
  2332. read answer
  2333. echo -e $MONO
  2334. if [ "$answer" = "$((i-1))" ] || \
  2335. [ "$answer" = 'IP' ] || \
  2336. [ "$answer" = 'ip' ] || \
  2337. [ "$answer" = 'Ip' ] || \
  2338. [ "$answer" = 'i' ] || \
  2339. [ "$answer" = 'I' ];then
  2340. echo -e -n $COLOR$MESSAGE220 #" enter IP address ->"
  2341. read ipadrs
  2342. echo -n -e $COLOR4
  2343. echo $LPADMIN -p $PRINTERNAME -v socket://$ipadrs -E $PPDOPT
  2344. echo -e -n $MONO
  2345. $LPADMIN -p $PRINTERNAME -v socket://$ipadrs -E $PPDOPT
  2346. deviceuri=socket://$ipadrs
  2347. elif [ "$answer" = "$i" ] || \
  2348. [ "$answer" = 'A' ] || \
  2349. [ "$answer" = 'a' ] || \
  2350. [ "$answer" = 'Auto' ] || \
  2351. [ "$answer" = '' ] ;then
  2352. echo -n -e $COLOR4
  2353. echo $LPADMIN -p $PRINTERNAME -v $autoduris -E $PPDOPT
  2354. echo -n -e $MONO
  2355. $LPADMIN -p $PRINTERNAME -v $autoduris -E $PPDOPT
  2356. deviceuri=$autoduris
  2357. elif [ "$answer" = 'F' ] || [ "$answer" = 'f' ];then
  2358. echo -n -e $COLOR4
  2359. echo $LPADMIN -p $PRINTERNAME -v file:///tmp/printdata.prn -E $PPDOPT
  2360. echo -n -e $MONO
  2361. $LPADMIN -p $PRINTERNAME -v file:///tmp/printdata.prn -E $PPDOPT
  2362. deviceuri="file:///tmp/printdata.prn"
  2363. else
  2364. i=0
  2365. for deviceuri in $duri
  2366. do
  2367. if [ "$i" = "$answer" ];then
  2368. echo -e -n $COLOR4
  2369. echo $LPADMIN -p $PRINTERNAME -v $deviceuri -E $PPDOPT
  2370. echo -e -n $MONO
  2371. $LPADMIN -p $PRINTERNAME -v $deviceuri -E $PPDOPT
  2372. break
  2373. fi
  2374. i=$(($i+1))
  2375. done
  2376. fi
  2377. elif [ "$answer" = "file" ] || [ "$answer" = "File" ]; then
  2378. echo -e -n $COLOR4
  2379. echo $LPADMIN -p $PRINTERNAME -v file:///tmp/printdata.prn -E $PPDOPT
  2380. echo -e -n $MONO
  2381. $LPADMIN -p $PRINTERNAME -v file:///tmp/printdata.prn -E $PPDOPT
  2382. fi
  2383. if [ "${modelnhuc}" = 'FAX' ];then
  2384. if [ -e /usr/lib/cups/filter/brfaxfilter ];then
  2385. chmod 755 /usr/lib/cups/filter/brfaxfilter
  2386. fi
  2387. if [ -e /usr/lib32/cups/filter ];then
  2388. if [ ! -e /usr/lib32/cups/filter/brfaxfilter ];then
  2389. cp /usr/lib/cups/filter/brfaxfilter /usr/lib32/cups/filter/brfaxfilter
  2390. fi
  2391. chmod 755 /usr/lib32/cups/filter/brfaxfilter
  2392. fi
  2393. if [ -e /usr/lib64/cups/filter ];then
  2394. if [ ! -e /usr/lib64/cups/filter/brfaxfilter ];then
  2395. cp /usr/lib/cups/filter/brfaxfilter /usr/lib64/cups/filter/brfaxfilter
  2396. fi
  2397. chmod 755 /usr/lib64/cups/filter/brfaxfilter
  2398. fi
  2399. if [ -f /etc/init.d/cups ];then
  2400. /etc/init.d/cups restart
  2401. elif [ -f /etc/init.d/cupsys ];then
  2402. /etc/init.d/cupsys restart
  2403. else
  2404. service cups restart
  2405. fi
  2406. fi
  2407. socketdevice=$(echo "$deviceuri" | grep "socket:")
  2408. if [ -n "$socketdevice" ] && [ "$ipadrs" = '' ];then
  2409. ipadrs=$(echo $socketdevice | sed s/"socket:\/\/"//g | sed s/":.*$"//g)
  2410. fi
  2411. echo -e -n $COLOR$MESSAGE230 #"Test Print \? [y/N]. ->"
  2412. read answer
  2413. echo -e $MONO
  2414. if [ "$answer" = Y ] || [ "$answer" = y ]; then
  2415. echo wait 5s.
  2416. sleep 5
  2417. if [ -f $TESTPRINT ];then
  2418. echo lpr -P $PRINTERNAME $TESTPRINT
  2419. lpr -P "$PRINTERNAME" "$TESTPRINT"
  2420. elif [ -f $TESTPRINT2 ];then
  2421. echo lpr -P $PRINTERNAME $TESTPRINT2
  2422. lpr -P "$PRINTERNAME" "$TESTPRINT2"
  2423. else
  2424. echo "echo $PRINTERNAME \| lpr -P $PRINTERNAME"
  2425. echo "$PRINTERNAME" | lpr -P "$PRINTERNAME"
  2426. fi
  2427. fi
  2428. # Make uninstaller : daemon symlink
  2429. LPRPKGNAME=$(echo $LPRFILE |\
  2430. sed s/"_.*$"//g |\
  2431. sed s/"-.*$"//g)
  2432. CUPSPKGNAME=$(echo $CUPSFILE |\
  2433. sed s/"_.*$"//g |\
  2434. sed s/"-.*$"//g)
  2435. PDRVPKGNAME=$(echo $PDRVFILE |\
  2436. sed s/"_.*$"//g |\
  2437. sed s/"-.*$"//g)
  2438. echo "if ! [ -f /etc/init.d/cupsys ];then" >>$uninstaller_prn
  2439. echo " DUMMYCUPSYS=1" >>$uninstaller_prn
  2440. echo " ln -s /bin/true /etc/init.d/cupsys" >>$uninstaller_prn
  2441. echo "fi" >>$uninstaller_prn
  2442. echo "if ! [ -f /etc/init.d/cups ];then" >>$uninstaller_prn
  2443. echo " DUMMYCUPS=1" >>$uninstaller_prn
  2444. echo " ln -s /bin/true /etc/init.d/cups" >>$uninstaller_prn
  2445. echo "fi" >>$uninstaller_prn
  2446. echo "if ! [ -f /etc/init.d/lpd ];then" >>$uninstaller_prn
  2447. echo " DUMMYLPD=1" >>$uninstaller_prn
  2448. echo " ln -s /bin/true /etc/init.d/lpd" >>$uninstaller_prn
  2449. echo "fi" >>$uninstaller_prn
  2450. echo "if ! [ -f /etc/init.d/lprng ];then" >>$uninstaller_prn
  2451. echo " DUMMYLPRNG=1" >>$uninstaller_prn
  2452. echo " ln -s /bin/true /etc/init.d/lprng" >>$uninstaller_prn
  2453. echo "fi" >>$uninstaller_prn
  2454. #
  2455. #rm cupswrapper driver
  2456. if [ "$CUPSPKGNAME" != '' ];then
  2457. echo "$PREPKGCMDC" >>$uninstaller_prn
  2458. echo "$RMPKGCMD $CUPSPKGNAME""$pkgpostfix" >>$uninstaller_prn
  2459. fi
  2460. #
  2461. #rm lpd driver
  2462. if [ "$LPRPKGNAME" != '' ];then
  2463. echo "$PREPKGCMDL" >>$uninstaller_prn
  2464. echo "$RMPKGCMD $LPRPKGNAME""$pkgpostfix" >>$uninstaller_prn
  2465. fi
  2466. #rm pdrv driver
  2467. if [ "$PDRVPKGNAME" != '' ];then
  2468. echo "$PREPKGCMDP" >>$uninstaller_prn
  2469. echo "$RMPKGCMD $PDRVPKGNAME""$pkgpostfix" >>$uninstaller_prn
  2470. fi
  2471. if [ "$DUMMYCUPS" = 1 ] || \
  2472. [ "$DUMMYCUPSYS" = 1 ] || \
  2473. [ "$DUMMYLPD" = 1 ] || \
  2474. [ "$DUMMYLPRNG" = 1 ];then
  2475. echo 'if [ "$DUMMYCUPS" = 1 ];then' >>$uninstaller_prn
  2476. echo ' lsc=$(ls -al /etc/init.d/cups 2> /dev/null| grep ^l)' >>$uninstaller_prn
  2477. echo ' if [ "$lsc" != "" ];then' >>$uninstaller_prn
  2478. echo ' rm -f /etc/init.d/cups' >>$uninstaller_prn
  2479. echo ' fi' >>$uninstaller_prn
  2480. echo 'fi' >>$uninstaller_prn
  2481. echo '' >>$uninstaller_prn
  2482. echo 'if [ "$DUMMYCUPSYS" = 1 ];then' >>$uninstaller_prn
  2483. echo ' lsc=$(ls -al /etc/init.d/cupsys 2> /dev/null| grep ^l)' >>$uninstaller_prn
  2484. echo ' if [ "$lsc" != "" ];then' >>$uninstaller_prn
  2485. echo ' rm -f /etc/init.d/cupsys' >>$uninstaller_prn
  2486. echo ' fi' >>$uninstaller_prn
  2487. echo 'fi' >>$uninstaller_prn
  2488. echo '' >>$uninstaller_prn
  2489. echo 'if [ "$DUMMYLPD" = 1 ];then' >>$uninstaller_prn
  2490. echo ' lsc=$(ls -al /etc/init.d/lpd 2> /dev/null | grep ^l)' >>$uninstaller_prn
  2491. echo ' if [ "$lsc" != "" ];then' >>$uninstaller_prn
  2492. echo ' rm -f /etc/init.d/lpd' >>$uninstaller_prn
  2493. echo ' fi' >>$uninstaller_prn
  2494. echo 'fi' >>$uninstaller_prn
  2495. echo '' >>$uninstaller_prn
  2496. echo 'if [ "$DUMMYLPRNG" = 1 ];then' >>$uninstaller_prn
  2497. echo ' lsc=$(ls -al /etc/init.d/lprng | grep ^l)' >>$uninstaller_prn
  2498. echo ' if [ "$lsc" != "" ];then' >>$uninstaller_prn
  2499. echo ' rm -f /etc/init.d/lprng' >>$uninstaller_prn
  2500. echo ' fi' >>$uninstaller_prn
  2501. echo 'fi' >>$uninstaller_prn
  2502. echo $rm32filter >>$uninstaller_prn
  2503. echo $rm64filter >>$uninstaller_prn
  2504. fi
  2505. if [ "$SCAN" != '' ];then
  2506. echo $SCAN
  2507. fi
  2508. if [ "$SKEY" != '' ];then
  2509. echo $SKEY
  2510. fi
  2511. chmod 744 $uninstaller_prn
  2512. pre_proc
  2513. scanner_install # scanner
  2514. post_proc
  2515. if [ "$1" = '' ];then
  2516. echo -e -n $COLOR$MESSAGE240$MONO #"Hit Return/Enter Key"
  2517. read answer
  2518. fi
  2519. #DBG_MSG "exit 20"
  2520. exit 0