From 05adaa9794e41d02870a74a1ed7ba58cc59b9286 Mon Sep 17 00:00:00 2001 From: nbd Date: Wed, 22 Nov 2006 23:30:57 +0000 Subject: rename default/ to files/ git-svn-id: svn://svn.openwrt.org/openwrt/trunk@5622 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- .../base-files/files/etc/hotplug.d/block/01-mount | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 package/base-files/files/etc/hotplug.d/block/01-mount (limited to 'package/base-files/files/etc/hotplug.d/block') diff --git a/package/base-files/files/etc/hotplug.d/block/01-mount b/package/base-files/files/etc/hotplug.d/block/01-mount new file mode 100755 index 000000000..db8ccdabd --- /dev/null +++ b/package/base-files/files/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 && rmdir /tmp/$DEV + rm -f /dev/$DEV /tmp/$DEV + ;; +esac +} 2>&1 | logger -- cgit v1.2.3