2
# Lifts a plugged in nomad jukebox to user space and
3
# optionally runs a client program.
4
# Written by Linus Walleij 2004, based on the "usbcam"
5
# script by Nalin Dahyabhai.
8
PROGRAM="cd ~; gnomad2 --display=localhost:0"
10
if [ "${ACTION}" = "add" ] && [ -f "${DEVICE}" ]
12
# New code, using lock files instead of copying /dev/console permissions
13
# This also works with non-gdm logins (e.g. on a virtual terminal)
14
# Idea and code from Nalin Dahyabhai <nalin@redhat.com>
15
if [ "x$DEVICEOWNER" = "xCONSOLE" ]
17
if [ -f /var/run/console.lock ]
19
DEVICEOWNER=`cat /var/run/console.lock`
20
elif [ -f /var/lock/console.lock ]
22
DEVICEOWNER=`cat /var/lock/console.lock`
27
if [ -n "$DEVICEOWNER" ]
29
chmod 0000 "${DEVICE}"
30
chown "${DEVICEOWNER}" "${DEVICE}"
31
chmod "${DEVICEPERMS}" "${DEVICE}"
32
# Then run an optional program - this does not work yet.
33
# su "${CONSOLEOWNER}" -c "${PROGRAM}"