mirror of
https://codeberg.org/andersonarc/reliant-system.git
synced 2026-01-06 18:55:39 -05:00
27 lines
617 B
Bash
Executable file
27 lines
617 B
Bash
Executable file
#!/usr/bin/bash
|
|
set -euo pipefail
|
|
RED="\e[31;1m"
|
|
GREEN="\e[32;1m"
|
|
ENDCOLOR="\e[0m"
|
|
|
|
if [ "$EUID" -ne 0 ]; then
|
|
echo "Must be superuser."
|
|
exit 1
|
|
fi
|
|
|
|
if [ ! -d /run/shufflecake ]; then
|
|
echo "Running in unsafe/maintenance mode, reliant-status not available."
|
|
exit 1
|
|
fi
|
|
|
|
for device in /dev/mapper/sflc_*; do
|
|
result=$(blockdev --getro $device)
|
|
if [ "$result" -eq 1 ]; then
|
|
echo -e "$device ${GREEN}sealed${ENDCOLOR}"
|
|
elif [ "$result" -eq 0 ]; then
|
|
echo -e "$device ${RED}unsealed${ENDCOLOR}"
|
|
else
|
|
echo "Could not determine device status."
|
|
exit 1
|
|
fi
|
|
done
|