fix detect active

This commit is contained in:
rootzoll
2025-01-19 10:45:38 +01:00
parent be8d389a09
commit 699ee072d4

View File

@@ -510,14 +510,10 @@ if [ "$action" = "status" ] || [ "$action" = "mount" ] || [ "$action" = "unmount
# check if any partition of device is mounted as root # check if any partition of device is mounted as root
installDeviceActive=0 installDeviceActive=0
if [ ${#installDevice} -gt 0 ]; then if [ ${#installDevice} -gt 0 ]; then
# get all partitions and check if mounted as root rootPartition=$(lsblk -no NAME,MOUNTPOINT "/dev/${installDevice}"| awk '$2 == "/"' | sed 's/[└├]─//g' | cut -d' ' -f1)
for partition in $(lsblk -no NAME "/dev/${installDevice}" | grep "^${installDevice}"); do if [ ${#rootPartition} -gt 0 ]; then
echo "# check partition ${partition}" installDeviceActive=1
if findmnt -n -o TARGET "/dev/${partition}" | grep -q "^/$"; then fi
installDeviceActive=1
break
fi
done
fi fi
################# #################