Skip to content
This repository was archived by the owner on Jun 16, 2024. It is now read-only.

Commit 01f382e

Browse files
feat(msix/md): check $status
1 parent a0c4709 commit 01f382e

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

home/hosts/msix.nix

+12-1
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,19 @@
5959
programs.fish.interactiveShellInit = ''
6060
function md
6161
read -P "[luks] password for btank: " -s LUKS_PASSWORD
62+
6263
echo "$LUKS_PASSWORD" | sudo cryptsetup luksOpen /dev/disk/by-uuid/5e05e286-205a-4063-9fa1-ac384bed4e9c luks_btank-data0
63-
and echo "$LUKS_PASSWORD" | sudo cryptsetup luksOpen /dev/disk/by-uuid/136e9203-0172-464e-a795-9f5ed11c96fa luks_btank-cache0
64+
if [ "$status" != 0 ]
65+
echo "failed to unlock LUKS device"
66+
return
67+
end
68+
69+
echo "$LUKS_PASSWORD" | sudo cryptsetup luksOpen /dev/disk/by-uuid/136e9203-0172-464e-a795-9f5ed11c96fa luks_btank-cache0
70+
if [ "$status" != 0 ]
71+
echo "failed to unlock LUKS device"
72+
return
73+
end
74+
6475
set -e LUKS_PASSWORD
6576
6677
echo 5000 | sudo tee /sys/fs/bcache/*/congested_read_threshold_us > /dev/null

0 commit comments

Comments
 (0)