⇤ ← Revision 1 as of 2014-01-13 18:26:49
Size: 751
Comment:
|
Size: 783
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 5: | Line 5: |
{{{ | {{{#!highlight bash |
Line 13: | Line 13: |
{{{ | {{{#!highlight bash |
udev
Automount usb stick
File /etc/udev/rules.d/99-automount.rules
File /lib/udev/automount with chmod 755:
1 #!/bin/bash
2 PATH=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin
3
4 DEV=$(basename $DEVNAME)
5
6 echo "$DEV $ACTION" >> /tmp/env.txt
7
8 case $ACTION in
9 add) mkdir -p /mnt/memory/$DEV
10 logger "automount: $ACTION $DEV"
11 mount -ouser,umask=0000 /dev/$DEV /mnt/memory/$DEV
12 ;;
13 remove)
14 logger "automount: $ACTION $DEV"
15 umount /mnt/memory/$DEV
16 ;;
17 esac