From 916f0db76effeb461b0eb5cc26e940aa8f6ac467 Mon Sep 17 00:00:00 2001 From: "Kevin Veen-Birkenbach [aka. Frantz]" Date: Sun, 3 May 2020 20:36:49 +0200 Subject: [PATCH] Optimized messages --- scripts/encryption/lock.sh | 8 ++++++-- scripts/encryption/unlock.sh | 11 ++++++----- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/scripts/encryption/lock.sh b/scripts/encryption/lock.sh index 220f3ad..da108e2 100644 --- a/scripts/encryption/lock.sh +++ b/scripts/encryption/lock.sh @@ -5,5 +5,9 @@ # # shellcheck source=/dev/null # Deactivate SC1090 source "$(dirname "$(readlink -f "${0}")")/../base.sh" || (echo "Loading base.sh failed." && exit 1) -echo "Locking directory $DECRYPTED_PATH..." -fusermount -u "$DECRYPTED_PATH" && echo "Data is now encrypted." && echo "Removing directory $DECRYPTED_PATH..." && rmdir "$DECRYPTED_PATH" +info "Locking directory $DECRYPTED_PATH..." && +fusermount -u "$DECRYPTED_PATH" || error "Unmounting failed." +info "Data is now encrypted." + +info "Removing directory $DECRYPTED_PATH..." && +rmdir "$DECRYPTED_PATH" || error "Failed." diff --git a/scripts/encryption/unlock.sh b/scripts/encryption/unlock.sh index 673fad7..09670b2 100644 --- a/scripts/encryption/unlock.sh +++ b/scripts/encryption/unlock.sh @@ -5,11 +5,12 @@ # # shellcheck source=/dev/null # Deactivate SC1090 source "$(dirname "$(readlink -f "${0}")")/../base.sh" || (echo "Loading base.sh failed." && exit 1) -echo "Unlocking directory $DECRYPTED_PATH..." +info "Unlocking directory $DECRYPTED_PATH..." if [ ! -d "$DECRYPTED_PATH" ] then - echo "Creating directory $DECRYPTED_PATH..." - mkdir "$DECRYPTED_PATH" + info "Creating directory $DECRYPTED_PATH..." && + mkdir "$DECRYPTED_PATH" || error "Failed." fi -echo "Encrypting directory $DECRYPTED_PATH to $DECRYPTED_PATH..." -encfs "$ENCRYPTED_PATH" "$DECRYPTED_PATH" && echo "ATTENTION: DATA IS NOW DECRYPTED!" +info "Encrypting directory $DECRYPTED_PATH to $DECRYPTED_PATH..." && +encfs "$ENCRYPTED_PATH" "$DECRYPTED_PATH" || error "Failed." +echo "ATTENTION: DATA IS NOW DECRYPTED!"