2
# Lifts a plugged in MTP device to user space and
3
# optionally runs a client program.
4
# Written by Linus Walleij 2006, based on the "usbcam"
5
# script by Nalin Dahyabhai.
9
# Special quirk for SuSE systems using "resmgr"
10
# (see http://rechner.lst.de/~okir/resmgr/)
11
if [ -f /sbin/resmgr ]
13
/sbin/resmgr "${ACTION}" "${DEVICE}" desktop usb
17
# This is for most other distributions
18
if [ "${ACTION}" = "add" ] && [ -f "${DEVICE}" ]
20
# New code, using lock files instead of copying /dev/console permissions
21
# This also works with non-gdm logins (e.g. on a virtual terminal)
22
# Idea and code from Nalin Dahyabhai <nalin@redhat.com>
23
if [ "x$DEVICEOWNER" = "xCONSOLE" ]
25
if [ -f /var/run/console/console.lock ]
27
DEVICEOWNER=`cat /var/run/console/console.lock`
28
elif [ -f /var/run/console.lock ]
30
DEVICEOWNER=`cat /var/run/console.lock`
31
elif [ -f /var/lock/console.lock ]
33
DEVICEOWNER=`cat /var/lock/console.lock`
39
if [ -n "$DEVICEOWNER" ]
41
chmod 0000 "${DEVICE}"
42
chown "${DEVICEOWNER}" "${DEVICE}"
43
chmod "${DEVICEPERMS}" "${DEVICE}"