summarylogtreecommitdiffstats
path: root/cndrvcups-lb.install
diff options
context:
space:
mode:
Diffstat (limited to 'cndrvcups-lb.install')
-rw-r--r--[-rwxr-xr-x]cndrvcups-lb.install71
1 files changed, 36 insertions, 35 deletions
diff --git a/cndrvcups-lb.install b/cndrvcups-lb.install
index 35d553aac49..0ea37e9055e 100755..100644
--- a/cndrvcups-lb.install
+++ b/cndrvcups-lb.install
@@ -1,41 +1,42 @@
-post_install(){
- if [ -d /usr/share/ppd ] ; then
- cd /usr/share/cups/model
- for fn in CN*ZK.ppd ; do \
- ln -sf "/usr/share/cups/model/"$fn /usr/share/ppd/$fn ;
- done
- fi
- chmod 4755 /usr/bin/cnpkmoduleufr2
- cat << EOF
- >>> Installation:
- >>> 1) Make sure CUPS is running and your printer is turned on and connected to your computer.
- >>> eg.
- >>> systemctl start cups
- >>>
- >>> 2) Check the name of the device, udev created for you.
- >>> eg. /dev/usb/lp0
- >>>
- >>> 3) /usr/sbin/lpadmin -p [Printer Name] -m [PPD file] -v usb:[device file location] -E
- >>> eg.
- >>> /usr/sbin/lpadmin -p LBP2900 -m CNCUPSLBP2900CAPTK.ppd -v usb:/dev/usblp0 -E
- >>> you can find ppds in the /usr/share/cups/model/ directory)
- >>>
- >>> 4) Now you can print. Consider using "systemctl enable cups" to have it start automatically on boot
-
-EOF
+post_remove() {
+ # Since this wasn't done in package() we need to leave this unsafe code in for who knows how long? 2018-04-18
+ if [ -d '/usr/share/ppd' ] ; then
+ rm -f /usr/share/ppd/CN*ZK.ppd
+ fi
}
-post_upgrade(){
- post_remove
- post_install
+_fn_post_up() {
+ # This creates duplicate entries in CUPS. It should have been done in package()
+ #if [ -d '/usr/share/ppd' ] ; then
+ # cd '/usr/share/cups/model'
+ # for fn in CN*ZK.ppd ; do \
+ # ln -sf "/usr/share/cups/model/$fn" "/usr/share/ppd/$fn"
+ # done
+ #fi
+ chmod 4755 '/usr/bin/cnpkmoduleufr2'
}
-post_remove(){
- if [ -d /usr/share/ppd ] ; then
- rm -rf /usr/share/ppd/CN*ZK.ppd
- fi
+post_upgrade() {
+ post_remove
+ _fn_post_up
}
-op=$1
-shift
-$op $*
+post_install() {
+ _fn_post_up
+ echo '
+>>> Installation:
+>>> 1) Make sure CUPS is running and your printer is turned on and connected to your computer.
+>>> eg.
+>>> systemctl start cups
+>>>
+>>> 2) Check the name of the device, udev created for you.
+>>> eg. /dev/usb/lp0
+>>>
+>>> 3) /usr/bin/lpadmin -p [Printer Name] -m [PPD file] -v usb:[device file location] -E
+>>> eg.
+>>> /usr/bin/lpadmin -p LBP2900 -m CNCUPSLBP2900CAPTK.ppd -v usb:/dev/usblp0 -E
+>>> you can find ppds in the /usr/share/cups/model/ directory)
+>>>
+>>> 4) Now you can print. Consider using "systemctl enable cups" to have it start automatically on boot
+'
+}