#!/bin/sh
#
# What to do with this USB hotplug event?
#
case $ACTION in
add)
#echo $ACTION>/dev/tts/0
DIR="/dev/ub"
for I in "$DIR/"*;do
#echo $I>/dev/tts/0
if [ -d $I -a -e $I/part1 ];then
#echo "found&mount $I/part1">/dev/tts/0
mount -t vfat $I/part1 /mnt 2>/dev/tts/0
else
#echo "$I/part1 not found">/dev/tts/0
sleep 1;
if [ -d $I -a -e $I/part1 ];then
#echo "found&mount $I/part1">/dev/tts/0
mount -t vfat $I/part1 /mnt 2>/dev/tts/0
fi
fi
done
;;
remove)
#echo $ACTION>/dev/tts/0
#echo "umount /mnt">/dev/tts/0
umount /mnt 2>/dev/tts/0
;;
*)
exit 1
;;
esac
后记:
这脚本太简单了,建议使用usbautomount^_^。
posted on 2007-09-19 14:13
lfc 阅读(969)
评论(0) 编辑 收藏 引用