The officially official Devuan Forum!

You are not logged in.

#1 2017-08-04 14:47:05

viverna
Member
Registered: 2017-07-02
Posts: 31  

Scanner and sane-utils

Hello folks,
I'm a new Devuan user (from Debian) from few week.
In Debian world I had a problem with my scanner, the script (run by user root) in /usr/local/bin/sanato solves the problem assigning group 'scanner' to device:

#!/bin/sh
line=`sane-find-scanner | grep 'found USB scanner' | sed -e 's/.*libusb://'`
if [ "$line" = "" ]; then
        echo not found
else
        line=`echo $line | sed -e 's;:;/;'`
        chgrp scanner /dev/bus/usb/$line
fi

With devuan remained the problem. Sane-utils is systemd infected and so I wrote a new script:

#!/bin/sh
line=`lsusb|grep "Your model"|sed -e 's/Bus \([0-9]\+\) Device \([0-9]\+\).\+/\1\/\2/'`
if [ "$line" = "" ]; then
        echo not found
else
        chgrp scanner /dev/bus/usb/$line
fi

Change "Your model" with your scanner.

Udev rules that run script:

# /etc/udev/rules.d/42-usb-permissions.rules
SUBSYSTEM!="usb", GOTO="end_skip_usb"

ACTION=="add", RUN+="/usr/local/bin/sanato"

LABEL="end_skip_usb"

It can serve someone.

Offline

#2 2017-08-04 15:52:19

golinux
Administrator
Registered: 2016-11-25
Posts: 3,137  

Re: Scanner and sane-utils

Thanks and welcome, viverna.

Offline

#3 2017-09-23 14:05:25

viverna
Member
Registered: 2017-07-02
Posts: 31  

Re: Scanner and sane-utils

Thanks golinux.

Offline

Board footer