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.user < prev    next >
Encoding:
Text File  |  2006-08-30  |  974 b   |  31 lines

  1. #!/bin/bash
  2. # $Id: usbcam.user 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 just one certain user
  7.  
  8. USER=root
  9.  
  10. # can access it from user space. (Replace root with the user you want
  11. # to have access to the cameras.)
  12. #
  13. # Note that for this script to work, you'll need all of the following:
  14. # a) a line in the file /etc/hotplug/usermap that corresponds to the 
  15. #    camera you are using. You can get the correct lines for all cameras 
  16. #    supported by libgphoto2 by running "print-usb-usermap".
  17. # b) run your camera software as the user given above
  18. # c) a Linux kernel supporting hotplug and usbdevfs
  19. # d) the hotplug package (http://linux-hotplug.sourceforge.net/)
  20. #
  21. # In the usermap file, the first field "usb module" should be named 
  22. # "usbcam" like this script.
  23.  
  24. if [ "${ACTION}" = "add" ] && [ -f "${DEVICE}" ]
  25. then
  26.     chmod a-rwx "${DEVICE}"
  27.     chown "${USER}" "${DEVICE}"
  28.     chmod u+rw "${DEVICE}"
  29. fi
  30.