summaryrefslogtreecommitdiff
path: root/tools/openbsd/detach
blob: a5c209c5639a8de8d615fffe892ec9575af7ef6d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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