Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Install brother printer drivers on Ubuntu
- [ "`whoami`" != "root" ] && {
- echo "This script must be run as root."
- exit
- }
- #====[ PREREQUISITES ]===
- # These are requirements for all but the scanner (i.e. for printer & fax).
- # make sure ia32-libs are installed
- echo "* Catering pre-requisites..."
- [ "`uname -p`" == "x86_64" ] && {
- echo " - checking extra requirements for 64-bit systems..."
- [ "`dpkg --get-selections ia32-libs |awk '{print $1}'`" != "ia32-libs" ] && apt-get install ia32-libs
- #
- # Some additional requirements according to http://wiki.ubuntuusers.de/Brother/Drucker (also required by FaxDriver)
- [ "`dpkg --get-selections lib32stdc++6 |awk '{print $1}'`" != "lib32stdc++6" ] && apt-get install lib32stdc++6
- }
- echo " - making sure csh and cups are installed..."
- [ -z `which csh` ] && apt-get install csh
- [ -z `which cupsd` ] && apt-get install cups
- #
- # Create dirs for cups & lpd if not exists
- echo " - creating required directories..."
- [ ! -d /usr/lib/cups/filter ] && mkdir -p /usr/lib/cups/filter
- [ ! -d /usr/share/cups/model ] && mkdir /usr/share/cups/model
- [ ! -d /var/spool/lpd ] && mkdir /var/spool/lpd
- #===[ Printer ]===
- echo "* Installing printer drivers..."
- [ ! -f *lpr*.deb -o ! -f *cupswrapper*.deb ] && {
- cat<<ENDTEXT
- Could not find the printer driver packages.
- Make sure you downloaded them from the Brother site, and placed them in the
- same directory as this script. At least one of the following files is missing:
- - *lpr*.deb (e.g. mfc9120cnlpr-1.1.2-1.i386.deb)
- - *cupswrapper*.deb (e.g. mfc9120cncupswrapper-1.1.2-1.i386.deb)
- ENDTEXT
- exit
- }
- dpkg -i --force-architecture *lpr*.deb
- dpkg -i --force-architecture *cupswrapper*.deb
- [ "`uname -p`" == "x86_64" ] && {
- [ ! -d /usr/lib64/cups/filter ] && mkdir -p /usr/lib64/cups/filter
- ln -s /usr/lib/cups/filter/brlpdwrapper* /usr/lib64/cups/filter/ # nur x64
- }
- cat<<ENDTEXT
- -------------------------------------------------------------------------------
- If you do not see any error messages above, you should now be able to setup
- your printer by pointing your webbrowser to http://localhost:631/
- Furthermore, there may be some adjustments needed to the rc file
- (either /usr/local/Brother/inf/br(model name)rc - if this exists,
- otherwise /usr/Brother/Printer/modelname/inf/modelnamerc). If it says there
- PaperType=Letter
- you may want to change this to
- PaperType=A4
- For more possibly needed adjustments, please check the Brother FAQ at
- http://welcome.solutions.brother.com/bsc/public_s/id/linux/en/faq_prn.html#f00108
- ENDTEXT
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement