summaryrefslogtreecommitdiff
path: root/tools/openbsd/attach
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2020-08-24 18:45:34 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2020-08-24 18:45:34 +0200
commit2b3e02411ecc09e7d41741b5587655c9b2f955b7 (patch)
treed839746371ecb8ed64ac81d2e37c11fcd25a00ac /tools/openbsd/attach
parent787fb1d54ec9ee5fb941ae897fb201feb9cb2fd1 (diff)
parentad38bc6ecb80ddeb562841b33258dd53659b1da6 (diff)
Update upstream source from tag 'upstream/1.0.31'
Update to upstream version '1.0.31' with Debian dir aa7a39fe56343f5e164eec83783f4c923a394865
Diffstat (limited to 'tools/openbsd/attach')
-rwxr-xr-xtools/openbsd/attach15
1 files changed, 7 insertions, 8 deletions
diff --git a/tools/openbsd/attach b/tools/openbsd/attach
index b6c98c8..16ce31f 100755
--- a/tools/openbsd/attach
+++ b/tools/openbsd/attach
@@ -5,16 +5,15 @@ DEVNAME=$2
case $DEVCLASS in
0)
- # generic devices
case "$DEVNAME" in
ugen*)
- BUSNAME=`usbdevs -v -d | egrep "Controller|$DEVNAME\$" | grep -B 1 ugen0$ | head -n 1 | sed -e 's,Controller ,,' -e 's,:$,,' `
- echo $BUSNAME > /var/run/${DEVNAME}.bus
- # probably our scanner
- chgrp usb /dev/"$DEVNAME".*
- chgrp usb /dev/"$BUSNAME"
+ BUSNAME=$(usbdevs -vv | egrep "Controller|$DEVNAME\$" | grep -B 1 "$DEVNAME\$" | awk -F'[ :]' '/^Controller/ { print $2 }')
+ echo $BUSNAME > /var/run/${DEVNAME}.bus
+ chown _cups:_saned /dev/${DEVNAME}.* &&
+ chmod 660 /dev/${DEVNAME}.*
+ chown _cups:_saned $BUSNAME &&
+ chmod 660 $BUSNAME
;;
esac
-
- ;;
+ ;;
esac