Rev | Line | |
---|
[10604] | 1 | #!/bin/sh -
|
---|
| 2 | #
|
---|
| 3 | # Toggle writable state of the disk
|
---|
| 4 | #
|
---|
| 5 | # Rick van der Zwet <rick@wirelessleiden.nl>
|
---|
| 6 | #
|
---|
| 7 |
|
---|
| 8 |
|
---|
| 9 | mount -p | awk '{if($2 == "/"){ print $4}}' | grep -q ro && {
|
---|
| 10 | mount -uwo noatime /
|
---|
| 11 | mount -wo noatime /cfg
|
---|
| 12 | echo "# / - write"
|
---|
| 13 | echo "# /cfg - write"
|
---|
| 14 | echo "# Run again to protect"
|
---|
| 15 | } || {
|
---|
[13721] | 16 | echo "# Please wait, it takes between 30-60 seconds to"
|
---|
| 17 | echo "# remount partition disk read-only again"
|
---|
[10604] | 18 | mount -ur /
|
---|
| 19 | umount /cfg
|
---|
| 20 | echo "# / - read"
|
---|
| 21 | echo "# /cfg - ejected"
|
---|
| 22 | echo "# Run again to edit"
|
---|
| 23 | }
|
---|
| 24 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.