#!/bin/bash # $Id: usbcam.group,v 1.2 2002/02/17 18:04:42 hun Exp $ # # /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 chmod g-rw "${DEVICE}" chgrp camera "${DEVICE}" chmod g+rw "${DEVICE}" fi