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