diff options
Diffstat (limited to 'install')
-rw-r--r-- | install | 151 |
1 files changed, 5 insertions, 146 deletions
@@ -1,148 +1,7 @@ post_install() { -/opt/brother/Printers/DCP1510/inf/setupPrintcap DCP1510 -i USB -/opt/brother/Printers/DCP1510/inf/braddprinter -i DCP1510 -if [ ! -e /usr/sbin/pstops ];then - PSTOPS=/usr/bin/pstops - if [ "`echo $PSTOPS | grep -i cups`" != "" ];then - PSTOPS="" - fi - if [ "$PSTOPS" != "" ];then - echo \[psconvert2\] >>/opt/brother/Printers/DCP1510/inf/brDCP1510func - echo pstops=$PSTOPS >>/opt/brother/Printers/DCP1510/inf/brDCP1510func - fi -fi - -ln -s /opt/brother/Printers/DCP1510/inf/brDCP1510rc /etc/opt/brother/Printers/DCP1510/inf/brDCP1510rc - -if [ ! -e /usr/bin/brprintconflsr3_DCP1510 ];then - echo "#! /bin/sh" > /usr/bin/brprintconflsr3_DCP1510 - echo "/opt/brother/Printers/DCP1510/lpd/brprintconflsr3 -P DCP1510" '$''*' >>/usr/bin/brprintconflsr3_DCP1510 - chmod 755 /usr/bin/brprintconflsr3_DCP1510 -fi - - -if [ -e /usr/lib/cups/filter ] && [ ! -e /usr/lib/cups/filter/brother_lpdwrapper_DCP1510 ];then - ln -s /opt/brother/Printers/DCP1510/cupswrapper/brother_lpdwrapper_DCP1510 /usr/lib/cups/filter -fi -if [ -e /usr/lib32/cups/filter ] && [ ! -e /usr/lib32/cups/filter/brother_lpdwrapper_DCP1510 ];then - ln -s /opt/brother/Printers/DCP1510/cupswrapper/brother_lpdwrapper_DCP1510 /usr/lib32/cups/filter -fi -if [ -e /usr/lib64/cups/filter ] && [ ! -e /usr/lib64/cups/filter/brother_lpdwrapper_DCP1510 ];then - ln -s /opt/brother/Printers/DCP1510/cupswrapper/brother_lpdwrapper_DCP1510 /usr/lib64/cups/filter -fi -if [ -e /usr/libexec/cups/filter ] && [ ! -e /usr/libexec/cups/filter/brother_lpdwrapper_DCP1510 ];then - ln -s /opt/brother/Printers/DCP1510/cupswrapper/brother_lpdwrapper_DCP1510 /usr/libexec/cups/filter -fi - -if [ -e /usr/share/cups/model ];then - ln -s /opt/brother/Printers/DCP1510/cupswrapper/brother-DCP1510-cups-en.ppd /usr/share/cups/model - PPDDIR=/usr/share/cups/model/ -fi -if [ -e /usr/share/ppd ];then - if [ ! -e /usr/share/ppd/brother ];then - mkdir /usr/share/ppd/brother - fi - ln -s /opt/brother/Printers/DCP1510/cupswrapper/brother-DCP1510-cups-en.ppd /usr/share/ppd/brother - PPDDIR=/usr/share/ppd/brother/ -fi -uris=$(lpinfo -v) - -for uri in $uris -do - URI=$(echo $uri | grep DCP-1510 | grep usb) - if [ "$URI" != '' ];then - break; - fi -done - -if [ "$URI" = '' ];then - for uri in $uris - do - URI=$(echo $uri | grep DCP-1510) - if [ "$URI" != '' ];then - break; - fi - done -fi -if [ "$URI" = '' ];then - for uri in $uris - do - URI=$(echo $uri | grep -i Brother | grep usb) - if [ "$URI" != '' ];then - break; - fi - done -fi -if [ "$URI" = '' ];then - for uri in $uris - do - URI=$(echo $uri | grep usb) - if [ "$URI" != '' ];then - break; - fi - done -fi -if [ "$URI" = '' ];then - URI="usb://dev/usb/lp0" -fi -if [ "$(which semanage 2> /dev/null)" != '' ];then - semanage fcontext -a -t cupsd_rw_etc_t '/etc/opt/brother/Printers/DCP1510/inf(/.*)?' - semanage fcontext -a -t cupsd_rw_etc_t '/opt/brother/Printers/DCP1510/inf(/.*)?' - semanage fcontext -a -t bin_t '/opt/brother/Printers/DCP1510/lpd(/.*)?' - semanage fcontext -a -t bin_t '/opt/brother/Printers/DCP1510/cupswrapper(/.*)?' - - if [ "$(which restorecon 2> /dev/null)" != '' ];then - restorecon -R /opt/brother/Printers/DCP1510 - restorecon -R /etc/opt/brother/Printers/DCP1510 - fi -fi - -echo "Start your cups service:" -echo ">>> systemctl start org.cups.cupsd" -echo "and add your printer in http://localhost:631/admin" -} - -pre_remove() { -/opt/brother/Printers/DCP1510/inf/setupPrintcap DCP1510 -e USB -/opt/brother/Printers/DCP1510/inf/braddprinter -e DCP1510 -rm -fR /var/spool/lpd/DCP1510/* 2>/dev/null -rm /etc/opt/brother/Printers/DCP1510/inf/brDCP1510rc 2>/dev/null - -if [ -e /usr/bin/brprintconflsr3_DCP1510 ];then - rm /usr/bin/brprintconflsr3_DCP1510 -fi - -if [ -e /usr/lib/cups/filter/brother_lpdwrapper_DCP1510 ];then - rm /usr/lib/cups/filter/brother_lpdwrapper_DCP1510 -fi -if [ -e /usr/lib32/cups/filter/brother_lpdwrapper_DCP1510 ];then - rm /usr/lib32/cups/filter/brother_lpdwrapper_DCP1510 -fi -if [ -e /usr/lib64/cups/filter/brother_lpdwrapper_DCP1510 ];then - rm /usr/lib64/cups/filter/brother_lpdwrapper_DCP1510 -fi -if [ -e /usr/libexec/cups/filter/brother_lpdwrapper_DCP1510 ];then - rm /usr/libexec/cups/filter/brother_lpdwrapper_DCP1510 -fi -if [ -e /usr/share/ppd/brother/brother-DCP1510-cups-en.ppd ];then - rm /usr/share/ppd/brother/brother-DCP1510-cups-en.ppd - rmdir /usr/share/ppd/brother 2> /dev/null -fi -if [ -e /usr/share/cups/model/brother-DCP1510-cups-en.ppd ];then - rm /usr/share/cups/model/brother-DCP1510-cups-en.ppd -fi -} - -post_remove() { -if [ "$(which semanage 2> /dev/null)" != '' ];then - semanage fcontext -d -t cupsd_rw_etc_t '/opt/brother/Printers/DCP1510/inf(/.*)?' - semanage fcontext -d -t cupsd_rw_etc_t '/etc/opt/brother/Printers/DCP1510/inf(/.*)?' - semanage fcontext -d -t bin_t '/opt/brother/Printers/DCP1510/lpd(/.*)?' - semanage fcontext -d -t bin_t '/opt/brother/Printers/DCP1510/cupswrapper(/.*)?' - - if [ "$(which restorecon 2> /dev/null)" != '' ];then - restorecon -R /opt/brother/Printers/DCP1510 - restorecon -R /etc/opt/brother/Printers/DCP1510 - fi -fi +echo "" +echo ">>> Start your cups service:" +echo ">>> systemctl start org.cups.cupsd" +echo ">>> and add your printer in http://localhost:631/admin" +echo "" } |