Index: /branches/releng-9.0/nanobsd/files/tools/cfedit
===================================================================
--- /branches/releng-9.0/nanobsd/files/tools/cfedit	(revision 10604)
+++ /branches/releng-9.0/nanobsd/files/tools/cfedit	(revision 10604)
@@ -0,0 +1,22 @@
+#!/bin/sh -
+#
+# Toggle writable state of the disk
+#
+# Rick van der Zwet <rick@wirelessleiden.nl>
+#
+
+
+mount -p | awk '{if($2 == "/"){ print $4}}' | grep -q ro && {
+    mount -uwo noatime /
+    mount -wo noatime /cfg
+    echo "# /    - write"
+    echo "# /cfg - write"
+    echo "# Run again to protect"
+  } || {
+    mount -ur /
+    umount /cfg
+    echo "# /    - read"
+    echo "# /cfg - ejected"
+    echo "# Run again to edit"
+  }
+
