#!/bin/sh - # # Toggle writable state of the disk # # Rick van der Zwet # 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" } || { echo "# Please wait, it takes between 30-60 seconds to" echo "# remount partition disk read-only again" mount -ur / umount /cfg echo "# / - read" echo "# /cfg - ejected" echo "# Run again to edit" }