summaryrefslogtreecommitdiff
path: root/tools/openbsd/detach
blob: 8566e515285d0815f6995f9364c73e9bc5226030 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh

DEVCLASS=$1
DEVNAME=$2

case $DEVCLASS in
0)
	case "$DEVNAME" in
	ugen*)
		BUSNAME=$(cat /var/run/${DEVNAME}.bus)
		rm -f /var/run/${DEVNAME}.bus
		chown root:wheel /dev/${DEVNAME}.* &&
			chmod 600 /dev/${DEVNAME}.*
		test -n "$BUSNAME" && {
			chown root:wheel $BUSNAME &&
				chmod 600 $BUSNAME
		}
		;;
	esac
	;;
esac