mirror of
https://github.com/Snigdha-OS/snigdhaos-pkgbuilds.git
synced 2025-09-22 04:25:02 +02:00

Some checks are pending
Check Conventional Commit / check-commit-message (push) Waiting to run
18 lines
466 B
Bash
Executable File
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
|