updated on Thu Jan 19 20:01:47 UTC 2012
[aur-mirror.git] / brother-hl4150cdn / brother-hl4150cdn.install
blob39ddba9de039646f36af4b39205529923f7f875b
1 MODEL=hl4150cdn
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/Printer/hl4150cdn/inf/brhl4150cdnrc >> /usr/share/Brother/Printer/hl4150cdn/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