diff options
Diffstat (limited to 'packaging/usbcam.group')
-rwxr-xr-x | packaging/usbcam.group | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/packaging/usbcam.group b/packaging/usbcam.group new file mode 100755 index 000000000..980a2fe12 --- /dev/null +++ b/packaging/usbcam.group @@ -0,0 +1,26 @@ +#!/bin/bash +# $Id$ +# +# /etc/hotplug/usb/usbcam +# +# Sets up newly plugged in USB camera so that group "camera" +# can access it from user space +# +# Note that for this script to work, you'll need all of the following: +# a) a line in the file /etc/hotplug/usermap that corresponds to the +# camera you are using. You can get the correct lines for all cameras +# supported by gphoto2 by running "gphoto2 --print-usb-usermap". +# b) a group "camera" where all users allowed access to the +# camera are listed +# c) a Linux kernel supporting hotplug and usbdevfs +# d) the hotplug package (http://linux-hotplug.sourceforge.net/) +# +# In the usermap file, the first field "usb module" should be named +# "usbcam" like this script. +# + +if [ "${ACTION}" = "add" ] && [ -f "${DEVICE}" ] +then + chgrp camera "${DEVICE}" + chmod g+rw "${DEVICE}" +fi |