summaryrefslogtreecommitdiff
path: root/tools/openbsd/attach
diff options
context:
space:
mode:
Diffstat (limited to 'tools/openbsd/attach')
-rwxr-xr-xtools/openbsd/attach20
1 files changed, 20 insertions, 0 deletions
diff --git a/tools/openbsd/attach b/tools/openbsd/attach
new file mode 100755
index 0000000..b6c98c8
--- /dev/null
+++ b/tools/openbsd/attach
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+DEVCLASS=$1
+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"
+ ;;
+ esac
+
+ ;;
+esac