Files
CELESTIFYX 08abac9e7d
Some checks are pending
Check Conventional Commit / check-commit-message (push) Waiting to run
Refactoring repository...
2025-01-14 19:02:06 +02:00

18 lines
466 B
Bash
Executable File

#!/usr/bin/env bash
# Check if /proc/cmdline exists
if [[ -f "/proc/cmdline" ]]; then
# Check if booting from a Btrfs snapshot
if grep -qE 'subvol=@/.snapshots/[0-9]+/snapshot' /proc/cmdline; then
echo "Booting from a Btrfs snapshot.";
exit 0
else
echo "Not booting from a Btrfs snapshot.";
exit 1
fi
else
# Handle the case where /proc/cmdline is missing
echo "Error: /proc/cmdline not found.";
exit 2
fi