Debian Codegraph @

libnetmd/hotplug-netmd

raw
1 #!/bin/bash
2
3 # hack: wait 1 second to improve chance that /proc/bus/usb file is present during add
4 sleep 1
5
6 # handle add event
7 if [ "${ACTION}" = "add" ] && [ -f "${DEVICE}" ]
8 then
9 logger -t netmd NetMD plugged in at $DEVICE
10 chown root.usb $DEVICE
11 chmod ug+w $DEVICE
12
13 # create symbolic link to catch remove event
14 mkdir -p `dirname $REMOVER`
15 ln -s $0 $REMOVER
16 fi
17
18 # handle remove event
19 if [ "${ACTION}" = "remove" ]
20 then
21 logger -t netmd NetMD unplugged from $DEVICE
22 fi