Solo4K Support.
[vuplus_openvuplus_3.0] / meta-openvuplus / recipes-core / udev / udev-182 / autoumount.sh
diff --git a/meta-openvuplus/recipes-core/udev/udev-182/autoumount.sh b/meta-openvuplus/recipes-core/udev/udev-182/autoumount.sh
new file mode 100644 (file)
index 0000000..a8f26bf
--- /dev/null
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+get_mount_point() {
+       mount |grep /dev/$1 |cut -d ' ' -f3
+}
+
+DEVICE=$1
+
+if test -z $DEVICE; then
+       exit 1
+fi
+
+MOUNTPOINT="$(get_mount_point $DEVICE)"
+
+if test -n "${MOUNTPOINT}"; then
+       echo "[udev] umount -l ${MOUNTPOINT}"
+       umount -l ${MOUNTPOINT}
+fi
+