mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-09-18 19:50:35 +02:00
fix detect active
This commit is contained in:
@@ -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
|
||||||
|
|
||||||
#################
|
#################
|
||||||
|
Reference in New Issue
Block a user