scripts/forensic-mark-readonly: support standalone usage and configuration file usage
authorMichael Prokop <mika@grml.org>
Fri, 10 Jul 2020 08:01:17 +0000 (10:01 +0200)
committerMichael Prokop <mika@grml.org>
Fri, 10 Jul 2020 08:01:17 +0000 (10:01 +0200)
commit31e81f4ab51d9c47eb12a239b587c3b9dd204cf6
tree757285bb29f9e9ea1612a3f9df656365de4b6b9b
parent4f6592884c730d7aeaad331c95b45c9a1b8455e9
scripts/forensic-mark-readonly: support standalone usage and configuration file usage

Instead of accepting environment variable $DEVNAME we expect the
script to be invoked with and argument like /dev/sda1 (useful for
manual execution) or sda1 (when invoked via udev rule).

Support configuration via /etc/grml/forensic.conf with two variables:

* READONLY_MODE: if set to "disable" then the script won't modify
  block devices

* READONLY_IGNORE: this supports ignoring devices to not being set to
  read-only

While at it improve coding style.

This work was funded by Grml-Forensic.
scripts/forensic-mark-readonly