分类: LINUX
2011-05-21 17:54:38
KERNEL=="sda1", SUBSYSTEM=="block", RUN+="/root/usbmount.sh" |
#!/bin/bash LOG=/var/log/usb-hotplug.log lap=$(date --rfc-3339=ns) echo "$lap: $DEVPATH requesting $ACTION" >> $LOG if [ $ACTION == "add" ] then mount -t vfat -o umask=000,noatime,async,codepage=936,iocharset=gb2312 \ /dev/sda1 /media/usbkey elif [ $ACTION == "remove" ] then umount -l /media/usbkey fi |