nut-debian/debian/hotplug

25 lines
490 B
Plaintext
Raw Normal View History

2010-02-24 23:58:53 +02:00
#!/bin/bash
# taken from libgphoto2
GROUP=nut
# for previous udev versions
if [ "$ACTION" = "add" ] && [ -f "$DEVICE" ]
then
# check if $GROUP really exists
if getent group $GROUP > /dev/null; then
chmod 660 "$DEVICE"
chown root:$GROUP "$DEVICE"
fi
fi
# for recent udev versions
if [ "$ACTION" = "add" ] && [ -r "$DEVNAME" ]
then
# check if $GROUP really exists
if getent group $GROUP > /dev/null; then
chmod 660 "$DEVNAME"
chown root:$GROUP "$DEVNAME"
fi
fi