From: Xiangfu Liu <[email protected]>

thanks to Richard Sharpe

---
 .../base-files/files/etc/hotplug.d/block/10-mount  |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/package/base-files/files/etc/hotplug.d/block/10-mount 
b/package/base-files/files/etc/hotplug.d/block/10-mount
index 3896893..005b6d6 100644
--- a/package/base-files/files/etc/hotplug.d/block/10-mount
+++ b/package/base-files/files/etc/hotplug.d/block/10-mount
@@ -7,10 +7,13 @@ if [ `basename $blkdev` != "block" ]; then
     device=`basename $DEVPATH`
     case "$ACTION" in
        add)
-               swapon /dev/$device >/dev/null 2>/dev/null || (
-                       mkdir -p /mnt/$device
-                       mount /dev/$device /mnt/$device
-               )
+               mount /dev/$device
+               if [ $? = 255 ]; then
+                       swapon /dev/$device >/dev/null 2>/dev/null || (
+                               mkdir -p /mnt/$device
+                               mount /dev/$device /mnt/$device
+                       )
+               fi
                ;;
        remove)
                umount /dev/$device
-- 
1.6.3.3

_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to