From 54c0aa2af8e0b998d1666a13bd86e6abcd08a291 Mon Sep 17 00:00:00 2001 From: poeplva <132710624+poeplva@users.noreply.github.com> Date: Fri, 27 Oct 2023 21:58:05 +0300 Subject: [PATCH] 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. --- .local/bin/mounter | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/mounter b/.local/bin/mounter index b532e08..756d04d 100755 --- a/.local/bin/mounter +++ b/.local/bin/mounter @@ -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 uuid="${drive%% *}" uuid="${uuid//-}" # This is a bashism. - for open in $decrypted; do + [ -n "$decrypted" ] && for open in $decrypted; do [ "$uuid" = "$open" ] && break 1 done && continue 1 echo "🔒 $drive"