clean up hotplug mounting scripts
[openwrt.git] / package / base-files / default / 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
23 rm -rf /dev/$DEV /tmp/$DEV
24 ;;
25 esac
26 } 2>&1 | logger
This page took 0.041863 seconds and 5 git commands to generate.