summaryrefslogtreecommitdiff
path: root/tools/openbsd/detach
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2020-08-24 18:45:55 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2020-08-24 18:45:55 +0200
commita77bc1fcbdf83cfdac9570c0a0ac886b5534c90f (patch)
treed839746371ecb8ed64ac81d2e37c11fcd25a00ac /tools/openbsd/detach
parent787fb1d54ec9ee5fb941ae897fb201feb9cb2fd1 (diff)
parent2b3e02411ecc09e7d41741b5587655c9b2f955b7 (diff)
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'tools/openbsd/detach')
-rwxr-xr-xtools/openbsd/detach17
1 files changed, 8 insertions, 9 deletions
diff --git a/tools/openbsd/detach b/tools/openbsd/detach
index a5c209c..8566e51 100755
--- a/tools/openbsd/detach
+++ b/tools/openbsd/detach
@@ -5,18 +5,17 @@ DEVNAME=$2
case $DEVCLASS in
0)
- # generic devices
case "$DEVNAME" in
ugen*)
- BUSNAME=`cat /var/run/${DEVNAME}.bus`
+ 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
+ chown root:wheel /dev/${DEVNAME}.* &&
+ chmod 600 /dev/${DEVNAME}.*
+ test -n "$BUSNAME" && {
+ chown root:wheel $BUSNAME &&
+ chmod 600 $BUSNAME
+ }
;;
esac
-
- ;;
+ ;;
esac