rename default/ to files/
[openwrt.git] / package / base-files / files / etc / hotplug.d / block / 01-mount
1 #!/bin/sh
2 # Copyright (C) 2006 OpenWrt.org
3
4 DEV=${DEVPATH##*/}
5 {
6 echo "ACTION=$ACTION DEVPATH=$DEVPATH $0 $*"
7 case "$ACTION" in
8 add)
9 echo -ne "waiting for $DEV"
10 while [ ! -b /dev/$DEV ]; do {
11 echo -ne "."
12 sleep 1
13 time=$((time+1)); [ $time -gt 10 ] && break
14 }; done
15
16 [ ${DEV%%[0-9]} != ${DEV} ] && {
17 mkdir -p /tmp/$DEV
18 mount /dev/$DEV /tmp/$DEV -t auto -o sync
19 }
20 ;;
21 remove)
22 umount /tmp/$DEV && rmdir /tmp/$DEV
23 rm -f /dev/$DEV /tmp/$DEV
24 ;;
25 esac
26 } 2>&1 | logger
This page took 0.049782 seconds and 5 git commands to generate.