1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
|
#!/bin/sh -e
#
# phidgets.hotplug --
# Configures a Phidgets device to be accessible by members
# of the phidgets group.
#
# To activate:
# install -m755 -oroot -groot phidgets.hotplug /etc/hotplug.d/usb
#
case $PRODUCT in
6c2/38/*) :;; # QuadServoController
6c2/40/*) :;; # InterfaceKit 0/0/4
6c2/44/*) :;; # InterfaceKit 0/16/16
6c2/45/*) :;; # InterfaceKit 8/8/8
6c2/51/*) :;; # InterfaceKit 0/5/7
6c2/53/*) :;; # InterfaceKit 0/8/8
*) exit 0;; # not a Phidget
esac
# we only care for new devices
[[ $ACTION != add ]] && exit 0
# wait a while for the device node to become available
COUNT=3
while [[ ! -f $DEVICE ]] && ((COUNT-- > 0)); do sleep 1; done
/usr/bin/logger -t $0 "new Phidget $PRODUCT appeared at $DEVICE"
# configure device
chgrp phidgets $DEVICE
chmod 0660 $DEVICE
exit 0
# COPYRIGHT --
#
# This file is part of libphidgets, a user-space library for phidgets.
# libphidgets is (c) 2003-2005 Martin F. Krafft <krafft@ailab.ch> and
# distributed under the terms of the Artistic Licence. See the ./COPYING file
# in the source tree root for more information.
#
# THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
# MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|