openwrt U盘热插拔
2015-08-20 11:04
537 查看
自动挂载U盘:编辑 /etc/hotplug.d/block/10-mount 写入以下内容
#!/bin/ash case "$ACTION" in add) for i in $(ls /dev/ | grep 'sd[a-z][1-9]') do mkdir -p /mnt/$i mount -o iocharset=utf8,rw /dev/$i /mnt/$i if [ $? -ne 0 ] then mount -o rw /dev/$i /mnt/$i fi done ;; remove) MOUNT=`mount | grep -o '/mnt/sd[a-z][1-9]'` for i in $MOUNT do umount $i if [ $? -eq 0 ] then rm -r $i fi done ;; esac
相关文章推荐
- Linux核心接口Netlink
- OK335xS Linux Qt make: icpc: Command not found
- Linux多线程技术总结
- Linux 64bit yum同时安装32,,64位rpm包
- 窗口关闭setDefaultCloseOperation()的整理
- fork()函数与Linux中的多线程编程
- 杂了个谈(三)——解决CentOS下yum命令报404错误的问题
- Android shell 命令总结
- 网站下的robots
- Linux系统下Java程序的基本监控
- tomcat启动报错
- tomcat启动报错
- Apache DS管理的JAVA实现
- 使用docker 部署 ceph
- window.showModalDialog和window.open关闭子页面时刷新父页面
- opencv中imgproc库中函数详解(1)
- dd wipe 命令磁盘清空shell脚本,笔记本台机MAC通用
- linux /dev/shm的用途
- Makefile经典教程
- 微服务架构