updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / brother-hl2140 / brother-hl2140.install
blob83fdaaf06725edf41127ec536261c1dda0016998
1 MODEL=HL2140
3 advisorymsg() {
4   cat <<EOM
5   The usblp kernel module must be disabled before CUPS can detect the
6   printer.
8   Start CUPS after installation and type the command:
9       lpadmin -p $MODEL -E -v \$URL -P /usr/share/cups/model/$MODEL.ppd
10   where \$URL can be found using the command:
11       lpinfo -v | grep -i 'Brother'
12   You can also register the new printer using web interface at:
13       http://localhost:631/
15   You may have to add "$MODEL" to /usr/share/Brother/inf/brPrintList for
16   proper operation and extended printing options.
17 EOM
20 post_install() {
21   _port=`lpinfo -v | grep -i 'usb://Brother/' | head -1 | sed 's/direct //g'`
23   if [ "$_port" = '' ];then
24           _port="usb:/dev/usb/lp0"
25   fi
26   echo ""
27   echo "Added $MODEL configuration defaults to /usr/share/Brother/inf/brPrintList"
28   echo ""
29   cat /usr/share/Brother/inf/brHL2140rc >> /usr/share/Brother/inf/brPrintList
31 #  echo $MODEL >> /usr/share/Brother/inf/brPrintList
32 #  lpadmin -p $MODEL -E -v $_port -P /usr/share/cups/model/$MODEL.ppd
34   advisorymsg
37 post_upgrade() {
38   advisorymsg
41 pre_remove() {
42   echo "Remember to unregister the $MODEL:"
43   echo "    lpadmin -x $MODEL"
44   echo "Or visit the CUPS web interface at:"
45   echo "    http://localhost:631/"
46   # lpadmin -x $MODEL
48   # Reverse this
49   # echo $MODEL >> /usr/share/Brother/inf/brPrintList