Sophie

Sophie

distrib > Mandriva > 9.1 > i586 > by-pkgid > 032bff2c14d595b338c2099630b03cec > files > 54

libgphoto2-2.1.1-2mdk.i586.rpm

#!/bin/bash
# $Id: usbcam.group,v 1.2 2002/09/12 16:50:18 hun Exp $
#
# /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 by 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" ] && [ -f "${DEVICE}" ]
then
    chmod o-rwx "${DEVICE}"
    chgrp "${GROUP}" "${DEVICE}"
    chmod g+rw "${DEVICE}"
fi