summaryrefslogtreecommitdiffstats
path: root/modules.d/90crypt/crypt-cleanup.sh
blob: 94fa7243327640377a2898d352fa48768e48e3ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/sh

# close everything which is not busy
rm -f -- /etc/udev/rules.d/70-luks.rules > /dev/null 2>&1

if ! getarg rd.luks.uuid -d rd_LUKS_UUID > /dev/null 2>&1 && getargbool 1 rd.luks -d -n rd_NO_LUKS > /dev/null 2>&1; then
    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
fi