X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/05adaa9794e41d02870a74a1ed7ba58cc59b9286..7e450a1c869a5b227e3c91c4e71049059f1193e6:/package/base-files/files/etc/hotplug.d/block/01-mount?ds=sidebyside diff --git a/package/base-files/files/etc/hotplug.d/block/01-mount b/package/base-files/files/etc/hotplug.d/block/01-mount index db8ccdabd..a34580cb9 100755 --- a/package/base-files/files/etc/hotplug.d/block/01-mount +++ b/package/base-files/files/etc/hotplug.d/block/01-mount @@ -3,24 +3,23 @@ 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 + [ $((++time)) -gt 10 ] && break }; done + echo - [ ${DEV%%[0-9]} != ${DEV} ] && { + [ ${DEV%%[0-9]} != ${DEV} -a ${DEV%%[0-9]} != "loop" ] && { 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 + umount /tmp/$DEV && rm -f /dev/$DEV /tmp/$DEV ;; esac } 2>&1 | logger