️ perf: check necessary permission and files

This commit is contained in:
RiO
2024-12-24 02:49:58 +05:30
parent dbb26c01df
commit 53c5d48d72

View File

@@ -1,6 +1,14 @@
#!/bin/bash
if grep -qE 'subvol=@/.snapshots/[0-9]+/snapshot' /proc/cmdline; then
exit 0
if [[ -f /proc/cmdline ]]; then
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
echo "/proc/cmdline not found."
exit 2
fi
exit 1