libgphoto2/libgphoto-usbcam

33 lines
1.0 KiB
Plaintext
Raw Normal View History

#!/bin/bash
# $Id: usbcam.group 6766 2003-09-16 16:42:44Z hun $
#
# /etc/hotplug/usb/usbcam
#
# Sets up newly plugged in USB camera so that only members of the
# group
GROUP=camera
# can access it from user space. (Replace camera with the name of the
# group you want to have access to the cameras.)
#
# 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 libgphoto2 by running "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" ] && [ -e "${DEVNAME}" ]
then
chmod o-rwx "${DEVNAME}"
chgrp "${GROUP}" "${DEVNAME}"
chmod g+rw "${DEVNAME}"
fi