2 # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
3 # ex: ts=8 sw=4 sts=4 et filetype=sh
10 if [ -f /etc/crypttab ]; then
12 strstr "${l##luks-}" "${luks##luks-}" && exit 0
18 # parse for allow-discards
19 if strstr "$(cryptsetup --help)" "allow-discards"; then
20 if discarduuids=$(getargs "rd.luks.allow-discards"); then
21 discarduuids=$(str_replace "$discarduuids" 'luks-' '')
22 if strstr " $discarduuids " " ${luks##luks-}"; then
23 allowdiscards="allow-discards"
25 elif getargbool 0 rd.luks.allow-discards; then
26 allowdiscards="allow-discards"
30 echo "$luks $dev - timeout=0,$allowdiscards" >> /etc/crypttab
32 if command -v systemctl >/dev/null; then
33 systemctl daemon-reload
34 systemctl start cryptsetup.target