mirror of
https://github.com/Snigdha-OS/snigdhaos-pkgbuilds.git
synced 2025-12-06 08:03:50 +01:00
18 lines
453 B
Bash
Executable File
18 lines
453 B
Bash
Executable File
#!/bin/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
|