enhanced the ro() shell function.
authorHeiko Schlittermann (JUMPER) <hs@schlittermann.de>
Wed, 28 Nov 2012 21:42:55 +0100
changeset 6 10f684acb314
parent 5 6dec881621ea
child 7 fd788851e7e6
enhanced the ro() shell function. But it should be replaced by a ro/rw program as soon as possible.
ROOT/root/.bashrc
ROOT/usr/local/sbin/rw.not-yet
alix.txt.gpg
--- a/ROOT/root/.bashrc	Wed Jun 20 09:47:49 2012 +0200
+++ b/ROOT/root/.bashrc	Wed Nov 28 21:42:55 2012 +0100
@@ -1,6 +1,15 @@
-function ro() { mount -o remount,ro /; }
+function ro() { 
+    mount -o remount,ro / 
+    blockdev --setrw /dev/sda1
+    PS1="$_OLD_PS1"
+}
+
 function rw() {
+	blockdev --setrw /dev/sda1
         mount -o remount,rw /
+	_OLD_PS1="$PS1"
+	PS1="[RW] $PS1"
+
         test "$#" = 0 && return;
         "$@"
         rc=$?
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ROOT/usr/local/sbin/rw.not-yet	Wed Nov 28 21:42:55 2012 +0100
@@ -0,0 +1,16 @@
+#! /bin/sh
+
+rc=`mktemp`
+cat >>$rc <<_
+test -f $HOME/.bashrc && source $HOME/.bashrc
+PS1="[RW] $PS1"
+trap "DONE" EXIT
+_
+
+set-rw /
+if [ $# != 0 ]; then
+    "$@"
+else
+    bash --rcfile $rc
+fi
+set-ro /
Binary file alix.txt.gpg has changed