Arnaud Quette <[EMAIL PROTECTED]> wrote: > @Julien: can you please have a look at this point for us. > I've seen you already did it for SANE...
OK, better do it now than put it on the TODO list, right ? :) Files attached. hotplug script: don't add 0s to the vendor and product IDs. udev rules: some explanations ... SUBSYSTEM!="usb_device", ACTION!="add", GOTO="libhidups_rules_end" This line tells udev to jump to the matching LABEL statement if we're not adding a usb device. Avoids having to test all the rules, speeds up things. # MGE UPS SYSTEMS units SYSFS{idVendor}=="0463", SYSFS{idProduct}=="ffff", MODE="660", GROUP="@RUN_AS_USER@" ... Pretty much self-explanatory, really ;) If you need to run a script for a particular UPS, add ", RUN="/path/to/script" to the rule for this UPS. LABEL="libhidups_rules_end" The label for the previous GOTO. Please test the scripts, although being derived from mine, they should really just work (tm). (apologies and *duh* if they don't ;) JB. -- Julien BLACHE <[EMAIL PROTECTED]> | Debian, because code matters more Debian & GNU/Linux Developer | <http://www.debian.org> Public key available on <http://www.jblache.org> - KeyID: F5D6 5169 GPG Fingerprint : 935A 79F1 C8B3 3521 FD62 7CC7 CD61 4FD7 F5D6 5169
#!/bin/sh # # This file belongs to the nut-usb Debian package if [ "$ACTION" != "add" ]; then exit 0 fi case $PRODUCT in 463/ffff/*|463/1/*|51d/2/*) chown root:@RUN_AS_USER@ "$DEVICE" chmod 0660 "$DEVICE" ;; *) exit 0 ;; esac exit 0
# # This file belongs to the nut-usb Debian package # # udev rules file for libhidups SUBSYSTEM!="usb_device", ACTION!="add", GOTO="libhidups_rules_end" # MGE UPS SYSTEMS units SYSFS{idVendor}=="0463", SYSFS{idProduct}=="ffff", MODE="660", GROUP="@RUN_AS_USER@" SYSFS{idVendor}=="0463", SYSFS{idProduct}=="0001", MODE="660", GROUP="@RUN_AS_USER@" # APC units SYSFS{idVendor}=="051d", SYSFS{idProduct}=="0002", MODE="660", GROUP="@RUN_AS_USER@" LABEL="libhidups_rules_end"