initial version of scripts, config and debian package
[moebian] / install / umountroot
diff --git a/install/umountroot b/install/umountroot
new file mode 100755 (executable)
index 0000000..368d066
--- /dev/null
@@ -0,0 +1,18 @@
+#!/bin/sh
+# (c) copyright 2010 by Thomas Tanner <tanner@gmx.de>
+
+test "$#" -eq 0 && echo "$0 destination" && exit 1
+later=
+for d in `cat /proc/mounts | grep " $1/" | awk '{ print $2}'`; do
+    case $d in
+    $1/dev/pts|$1/dev/shm|$1/home/user/MyDocs)
+       #echo unmounting $d
+       umount $d
+       ;;
+    *)  later="$later $d" ;;
+    esac
+done
+for d in $later; do
+    #echo unmounting $d
+    umount $d
+done