home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 November (DVD) / PCWELT_11_2006.ISO / casper / filesystem.squashfs / usr / share / doc / libgphoto2-2 / linux-hotplug / usbcam.group < prev    next >
Encoding:
Text File  |  2006-08-30  |  1.0 KB  |  33 lines

  1. #!/bin/bash
  2. # $Id: usbcam.group 6766 2003-09-16 16:42:44Z hun $
  3. #
  4. # /etc/hotplug/usb/usbcam
  5. #
  6. # Sets up newly plugged in USB camera so that only members of the 
  7. # group
  8.  
  9. GROUP=camera
  10.  
  11. # can access it from user space. (Replace camera with the name of the
  12. # group you want to have access to the cameras.)
  13. #
  14. # Note that for this script to work, you'll need all of the following:
  15. # a) a line in the file /etc/hotplug/usermap that corresponds to the 
  16. #    camera you are using. You can get the correct lines for all cameras 
  17. #    supported by libgphoto2 by running "print-usb-usermap".
  18. # b) a group "camera" where all users allowed access to the
  19. #    camera are listed
  20. # c) a Linux kernel supporting hotplug and usbdevfs
  21. # d) the hotplug package (http://linux-hotplug.sourceforge.net/)
  22. #
  23. # In the usermap file, the first field "usb module" should be named 
  24. # "usbcam" like this script.
  25.  
  26. if [ "${ACTION}" = "add" ] && [ -f "${DEVICE}" ]
  27. then
  28.     chmod o-rwx "${DEVICE}"
  29.     chgrp "${GROUP}" "${DEVICE}"
  30.     chmod g+rw "${DEVICE}"
  31. fi
  32.