aboutsummaryrefslogtreecommitdiff
path: root/hotplug/libmpio.in
blob: 27c537007ed6fda8f9c7da8b65ca91a7dd0f2234 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash
#
# /etc/hotplug/usb/libmpio
#
# Fix permissions on device file, so
# "normal" users can access the MPIO player

MPIO_USER=@MPIOUSER@
MPIO_GROUP=@MPIOGROUP@
MPIO_PERM=@MPIOPERM@

if [ "$ACTION" = "add" ] &&
   [ "$TYPE" = "usb" ]   &&
   [ -f "${DEVICE}" ]   
then
    chmod 0000 "$DEVICE"
    chown $MPIO_USER "$DEVICE"
    chgrp $MPIO_GROUP "$DEVICE"
    chmod $MPIO_PERM "$DEVICE"
fi