Optimized messages

This commit is contained in:
Kevin Veen-Birkenbach 2020-05-03 20:36:49 +02:00
parent e7908d4359
commit 916f0db76e
2 changed files with 12 additions and 7 deletions

View File

@ -5,5 +5,9 @@
# #
# shellcheck source=/dev/null # Deactivate SC1090 # shellcheck source=/dev/null # Deactivate SC1090
source "$(dirname "$(readlink -f "${0}")")/../base.sh" || (echo "Loading base.sh failed." && exit 1) source "$(dirname "$(readlink -f "${0}")")/../base.sh" || (echo "Loading base.sh failed." && exit 1)
echo "Locking directory $DECRYPTED_PATH..." info "Locking directory $DECRYPTED_PATH..." &&
fusermount -u "$DECRYPTED_PATH" && echo "Data is now encrypted." && echo "Removing directory $DECRYPTED_PATH..." && rmdir "$DECRYPTED_PATH" fusermount -u "$DECRYPTED_PATH" || error "Unmounting failed."
info "Data is now encrypted."
info "Removing directory $DECRYPTED_PATH..." &&
rmdir "$DECRYPTED_PATH" || error "Failed."

View File

@ -5,11 +5,12 @@
# #
# shellcheck source=/dev/null # Deactivate SC1090 # shellcheck source=/dev/null # Deactivate SC1090
source "$(dirname "$(readlink -f "${0}")")/../base.sh" || (echo "Loading base.sh failed." && exit 1) 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" ] if [ ! -d "$DECRYPTED_PATH" ]
then then
echo "Creating directory $DECRYPTED_PATH..." info "Creating directory $DECRYPTED_PATH..." &&
mkdir "$DECRYPTED_PATH" mkdir "$DECRYPTED_PATH" || error "Failed."
fi fi
echo "Encrypting directory $DECRYPTED_PATH to $DECRYPTED_PATH..." info "Encrypting directory $DECRYPTED_PATH to $DECRYPTED_PATH..." &&
encfs "$ENCRYPTED_PATH" "$DECRYPTED_PATH" && echo "ATTENTION: DATA IS NOW DECRYPTED!" encfs "$ENCRYPTED_PATH" "$DECRYPTED_PATH" || error "Failed."
echo "ATTENTION: DATA IS NOW DECRYPTED!"