From 699ee072d405d51fb3dce936f3609377f0d56612 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Sun, 19 Jan 2025 10:45:38 +0100 Subject: [PATCH] fix detect active --- home.admin/config.scripts/blitz.data.sh | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/home.admin/config.scripts/blitz.data.sh b/home.admin/config.scripts/blitz.data.sh index 9ef407861..9c4cee4e0 100644 --- a/home.admin/config.scripts/blitz.data.sh +++ b/home.admin/config.scripts/blitz.data.sh @@ -510,14 +510,10 @@ if [ "$action" = "status" ] || [ "$action" = "mount" ] || [ "$action" = "unmount # check if any partition of device is mounted as root installDeviceActive=0 if [ ${#installDevice} -gt 0 ]; then - # get all partitions and check if mounted as root - for partition in $(lsblk -no NAME "/dev/${installDevice}" | grep "^${installDevice}"); do - echo "# check partition ${partition}" - if findmnt -n -o TARGET "/dev/${partition}" | grep -q "^/$"; then - installDeviceActive=1 - break - fi - done + rootPartition=$(lsblk -no NAME,MOUNTPOINT "/dev/${installDevice}"| awk '$2 == "/"' | sed 's/[└├]─//g' | cut -d' ' -f1) + if [ ${#rootPartition} -gt 0 ]; then + installDeviceActive=1 + fi fi #################