summaryrefslogtreecommitdiff
path: root/modules.d/90crypt/crypt-cleanup.sh
diff options
context:
space:
mode:
Diffstat (limited to 'modules.d/90crypt/crypt-cleanup.sh')
-rwxr-xr-xmodules.d/90crypt/crypt-cleanup.sh8
1 files changed, 6 insertions, 2 deletions
diff --git a/modules.d/90crypt/crypt-cleanup.sh b/modules.d/90crypt/crypt-cleanup.sh
index a9c976a7..1242b1ca 100755
--- a/modules.d/90crypt/crypt-cleanup.sh
+++ b/modules.d/90crypt/crypt-cleanup.sh
@@ -2,6 +2,10 @@
# close everything which is not busy
rm -f /etc/udev/rules.d/70-luks.rules >/dev/null 2>&1
-for i in /dev/mapper/luks-*; do
- cryptsetup luksClose $i >/dev/null 2>&1
+while true; do
+ local do_break="y"
+ for i in /dev/mapper/luks-*; do
+ cryptsetup luksClose $i >/dev/null 2>&1 && do_break=n
+ done
+ [ "$do_break" = "y" ] && break
done