summaryrefslogtreecommitdiffstats
path: root/package/base-files/files/etc/hotplug.d/block/10-mount
blob: b0104ddfd60a11e6a7e525bf2ad14a0fc84bd1b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh

# Copyright (C) 2009 OpenWrt.org

blkdev=`dirname $DEVPATH`
if [ `basename $blkdev` != "block" ]; then

    device=`basename $DEVPATH`
    case "$ACTION" in
	add)
		mkdir -p /mnt/$device
		mount /dev/$device /mnt/$device
		;;
	remove)
		umount /dev/$device
		;;
    esac	

fi