diff --git a/build/install-os-k.sh b/build/install-os-k.sh index 92cf6ad..6705e69 100755 --- a/build/install-os-k.sh +++ b/build/install-os-k.sh @@ -64,4 +64,12 @@ echo ${CL2}[install-os-k.sh]${NC} Sync image... \(sync\)${CL3} sync echo ${CL2}[install-os-k.sh]${NC} Unmount image... \(udisksctl\)${CL3} -udisksctl unmount --no-user-interaction -b $lpblock \ No newline at end of file +udisksctl unmount --no-user-interaction -b $lpblock + +lpblock=$(/sbin/losetup -j $1 | cut -d ':' -f 1) +if [ -z $lpblock ]; +then + return 0 +fi + +udisksctl loop-delete -b $lpblock