summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'media-gfx/iscan/files/iscan-usb.sh')
-rw-r--r--media-gfx/iscan/files/iscan-usb.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/media-gfx/iscan/files/iscan-usb.sh b/media-gfx/iscan/files/iscan-usb.sh
new file mode 100644
index 000000000000..e71bea4715c3
--- /dev/null
+++ b/media-gfx/iscan/files/iscan-usb.sh
@@ -0,0 +1,27 @@
+#!/bin/sh
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+# This file is part of media-gfx/iscan
+#
+# This script changes the permissions and ownership of a USB device under
+# /proc/bus/usb to grant access to this device to users in the scanner group.
+#
+# Ownership is set to root:scanner, permissions are set to 0660.
+#
+# Arguments :
+# -----------
+# ACTION=[add|remove]
+# DEVNAME=/dev/bus/usb/BBB/DDD
+# SUBSYSTEM=usb_device
+
+OWNER="root"
+GROUP="scanner"
+PERMS="0660"
+
+DEVICE="${DEVNAME/dev/proc}"
+
+if [ "${ACTION}" = "add" -a "${SUBSYSTEM}" = "usb_device" -a -f "${DEVICE}" ]; then
+ chmod ${PERMS} "${DEVICE}" && chown ${OWNER}:${GROUP} "${DEVICE}"
+fi