From 65ecb845000b9e8d378bb2f6b9bef769b7db0cfc Mon Sep 17 00:00:00 2001 From: eshanized Date: Mon, 30 Dec 2024 01:36:41 +0530 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20perf(format):=20code=20and?= =?UTF-8?q?=20ensured=20consistent=20indentation=20for=20better=20readabil?= =?UTF-8?q?ity?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- snigdhaos-libs/check-snapshot-boot | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/snigdhaos-libs/check-snapshot-boot b/snigdhaos-libs/check-snapshot-boot index b55aadd0..116196fe 100755 --- a/snigdhaos-libs/check-snapshot-boot +++ b/snigdhaos-libs/check-snapshot-boot @@ -1,6 +1,8 @@ #!/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 @@ -9,6 +11,7 @@ if [[ -f /proc/cmdline ]]; then exit 1 fi else - echo "/proc/cmdline not found." + # Handle the case where /proc/cmdline is missing + echo "Error: /proc/cmdline not found." exit 2 fi