#!/bin/bash # read-only-mode.sh detects and warns if running read-write on the root filesystem. # Check if the root filesystem is mounted as read-only if ! awk '$2 == "/" && $4 ~ /ro/ {found=1} END {exit !found}' /proc/mounts; then cat <