none of the encrypted devices are listed if no drives are decrypted already (#1338)

The part
```
for open in $decrypted; do
		[ "$uuid" = "$open" ] && break 1
done
```
exits with `0` if the variable `$decrypted` is empty, causing none of the encrypted devices to be put into the `$unopenedluks` variable. This commit fixes this problem.
This commit is contained in:
poeplva 2023-10-27 21:58:05 +03:00 committed by GitHub
parent bca6b403eb
commit 54c0aa2af8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -36,7 +36,7 @@ filter() { sed "s/ /:/g" | awk -F':' '$7==""{printf "%s%s (%s) %s\n",$1,$3,$5,$6
unopenedluks="$(for drive in $allluks; do unopenedluks="$(for drive in $allluks; do
uuid="${drive%% *}" uuid="${drive%% *}"
uuid="${uuid//-}" # This is a bashism. uuid="${uuid//-}" # This is a bashism.
for open in $decrypted; do [ -n "$decrypted" ] && for open in $decrypted; do
[ "$uuid" = "$open" ] && break 1 [ "$uuid" = "$open" ] && break 1
done && continue 1 done && continue 1
echo "🔒 $drive" echo "🔒 $drive"