Added creation of decrypted folder just if the folder doesn't exist

This commit is contained in:
Kevin Veen-Birkenbach 2019-10-02 16:51:08 +02:00
parent b9b315673f
commit 8ec28266b8

View File

@ -6,7 +6,10 @@
# shellcheck source=/dev/null # Deactivate SC1090
source "$(dirname "$(readlink -f "${0}")")/base.sh"
echo "Unlocking directory $DECRYPTED_PATH..."
if [ ! -d "$DECRYPTED_PATH" ]
then
echo "Creating directory $DECRYPTED_PATH..."
mkdir "$DECRYPTED_PATH"
fi
echo "Encrypting directory $DECRYPTED_PATH to $DECRYPTED_PATH..."
encfs "$ENCRYPTED_PATH" "$DECRYPTED_PATH" && echo "ATTENTION: DATA IS NOW DECRYPTED!"