Advertisement
Guest User

Install Brother printer drivers

a guest
Jul 22nd, 2012
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.53 KB | None | 0 0
  1. #!/bin/bash
  2. # Install brother printer drivers on Ubuntu
  3.  
  4. [ "`whoami`" != "root" ] && {
  5.   echo "This script must be run as root."
  6.   exit
  7. }
  8.  
  9. #====[ PREREQUISITES ]===
  10. # These are requirements for all but the scanner (i.e. for printer & fax).
  11. # make sure ia32-libs are installed
  12. echo "* Catering pre-requisites..."
  13. [ "`uname -p`" == "x86_64" ] && {
  14.   echo " - checking extra requirements for 64-bit systems..."
  15.   [ "`dpkg --get-selections ia32-libs |awk '{print $1}'`" != "ia32-libs" ] && apt-get install ia32-libs
  16. #
  17. # Some additional requirements according to http://wiki.ubuntuusers.de/Brother/Drucker (also required by FaxDriver)
  18.   [ "`dpkg --get-selections lib32stdc++6 |awk '{print $1}'`" != "lib32stdc++6" ] && apt-get install lib32stdc++6
  19. }
  20. echo " - making sure csh and cups are installed..."
  21. [ -z `which csh` ] && apt-get install csh
  22. [ -z `which cupsd` ] && apt-get install cups
  23. #
  24. # Create dirs for cups & lpd if not exists
  25. echo " - creating required directories..."
  26. [ ! -d /usr/lib/cups/filter ] && mkdir -p /usr/lib/cups/filter
  27. [ ! -d /usr/share/cups/model ] && mkdir /usr/share/cups/model
  28. [ ! -d /var/spool/lpd ] && mkdir /var/spool/lpd
  29.  
  30. #===[ Printer ]===
  31. echo "* Installing printer drivers..."
  32. [ ! -f *lpr*.deb -o ! -f *cupswrapper*.deb ] && {
  33.   cat<<ENDTEXT
  34. Could not find the printer driver packages.
  35. Make sure you downloaded them from the Brother site, and placed them in the
  36. same directory as this script. At least one of the following files is missing:
  37. - *lpr*.deb (e.g. mfc9120cnlpr-1.1.2-1.i386.deb)
  38. - *cupswrapper*.deb (e.g. mfc9120cncupswrapper-1.1.2-1.i386.deb)
  39. ENDTEXT
  40.   exit
  41. }
  42. dpkg -i --force-architecture *lpr*.deb
  43. dpkg -i --force-architecture *cupswrapper*.deb
  44. [ "`uname -p`" == "x86_64" ] && {
  45.   [ ! -d /usr/lib64/cups/filter ] && mkdir -p /usr/lib64/cups/filter
  46.   ln -s /usr/lib/cups/filter/brlpdwrapper* /usr/lib64/cups/filter/  # nur x64
  47. }
  48. cat<<ENDTEXT
  49. -------------------------------------------------------------------------------
  50. If you do not see any error messages above, you should now be able to setup
  51. your printer by pointing your webbrowser to http://localhost:631/
  52. Furthermore, there may be some adjustments needed to the rc file
  53. (either /usr/local/Brother/inf/br(model name)rc - if this exists,
  54. otherwise /usr/Brother/Printer/modelname/inf/modelnamerc). If it says there
  55. PaperType=Letter
  56. you may want to change this to
  57. PaperType=A4
  58. For more possibly needed adjustments, please check the Brother FAQ at
  59. http://welcome.solutions.brother.com/bsc/public_s/id/linux/en/faq_prn.html#f00108
  60. ENDTEXT
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement