From fe6908e6bd9b45e8597bb0e924e47c3ad6aa101a Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Wed, 23 Dec 2020 18:35:33 +0100 Subject: [PATCH] Optimized luksClose --- scripts/encryption/storage/base.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/encryption/storage/base.sh b/scripts/encryption/storage/base.sh index 302439b..1d8c645 100644 --- a/scripts/encryption/storage/base.sh +++ b/scripts/encryption/storage/base.sh @@ -33,8 +33,8 @@ create_luks_key_and_update_cryptab(){ fi sudo dd if=/dev/urandom of="$secret_key_path" bs=512 count=8 && sudo cryptsetup -v luksAddKey "$2" "$secret_key_path" && - info "Opening and closing device to verify that that everything works fine..." && - sudo cryptsetup -v luksClose "$1" && + info "Opening and closing device to verify that that everything works fine..." || error + sudo cryptsetup -v luksClose "$1" || info "No need to luksClose $1." sudo cryptsetup -v luksOpen "$2" "$1" --key-file="$secret_key_path" && sudo cryptsetup -v luksClose "$1" && info "Reading UUID..." &&