#!/bin/sh

GROUP=plugdev

if [ "${ACTION}" = "add" ]
then
    if getent group $GROUP > /dev/null; then
	N=0
	while [ ! -e $DEVICE ] && [ $N -lt 25 ]; do
		sleep 1
		N=$(expr $N + 1)
	done
	chmod 660 "${DEVICE}"
	chown root:$GROUP "${DEVICE}"
    fi
fi
