diff options
author | mbm <mbm@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2006-08-26 01:04:43 +0000 |
---|---|---|
committer | mbm <mbm@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2006-08-26 01:04:43 +0000 |
commit | 85b201f54538e4198183126a9f00130e2fc01df0 (patch) | |
tree | 8c2f29b2a5290c423d69b096ff2608c378ab3412 /package/base-files/default/etc/hotplug.d/block/01-mount | |
parent | 3f494f8d220f2b1a40a6749e814b46eca48792ac (diff) |
clean up hotplug mounting scripts
git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@4673 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/base-files/default/etc/hotplug.d/block/01-mount')
-rwxr-xr-x | package/base-files/default/etc/hotplug.d/block/01-mount | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/package/base-files/default/etc/hotplug.d/block/01-mount b/package/base-files/default/etc/hotplug.d/block/01-mount new file mode 100755 index 000000000..b6275e5a2 --- /dev/null +++ b/package/base-files/default/etc/hotplug.d/block/01-mount @@ -0,0 +1,26 @@ +#!/bin/sh +# Copyright (C) 2006 OpenWrt.org + +DEV=${DEVPATH##*/} +{ +echo "ACTION=$ACTION DEVPATH=$DEVPATH $0 $*" +case "$ACTION" in +add) + echo -ne "waiting for $DEV" + while [ ! -b /dev/$DEV ]; do { + echo -ne "." + sleep 1 + time=$((time+1)); [ $time -gt 10 ] && break + }; done + + [ ${DEV%%[0-9]} != ${DEV} ] && { + mkdir -p /tmp/$DEV + mount /dev/$DEV /tmp/$DEV -t auto -o sync + } + ;; +remove) + umount /tmp/$DEV + rm -rf /dev/$DEV /tmp/$DEV + ;; +esac +} 2>&1 | logger |