summaryrefslogtreecommitdiff
path: root/tools/openbsd/detach
diff options
context:
space:
mode:
Diffstat (limited to 'tools/openbsd/detach')
-rwxr-xr-xtools/openbsd/detach22
1 files changed, 22 insertions, 0 deletions
diff --git a/tools/openbsd/detach b/tools/openbsd/detach
new file mode 100755
index 0000000..a5c209c
--- /dev/null
+++ b/tools/openbsd/detach
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+DEVCLASS=$1
+DEVNAME=$2
+
+case $DEVCLASS in
+0)
+ # generic devices
+ case "$DEVNAME" in
+ ugen*)
+ BUSNAME=`cat /var/run/${DEVNAME}.bus`
+ rm -f /var/run/${DEVNAME}.bus
+ # probably our scanner
+ chgrp wheel /dev/"$DEVNAME".*
+ if [ x$BUSNAME != x ] ; then
+ chgrp wheel /dev/"$BUSNAME"
+ fi
+ ;;
+ esac
+
+ ;;
+esac