diff options
| author | poeplva <132710624+poeplva@users.noreply.github.com> | 2023-10-27 21:58:05 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-10-27 18:58:05 +0000 |
| commit | 54c0aa2af8e0b998d1666a13bd86e6abcd08a291 (patch) | |
| tree | da45302389ade6bafdfbd89defdad1e3f1806844 | |
| parent | bca6b403eb61df8f36e543a95ea48a07e546a9d3 (diff) | |
| download | eibhear-54c0aa2af8e0b998d1666a13bd86e6abcd08a291.tar.gz eibhear-54c0aa2af8e0b998d1666a13bd86e6abcd08a291.tar.zst eibhear-54c0aa2af8e0b998d1666a13bd86e6abcd08a291.zip | |
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.
| -rwxr-xr-x | .local/bin/mounter | 2 |
1 files changed, 1 insertions, 1 deletions
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" |
