Optimized lock mechanism

This commit is contained in:
Kevin Veen-Birkenbach 2019-09-30 23:48:03 +02:00
parent dc72bd5d31
commit 06c78211a1
2 changed files with 6 additions and 3 deletions

View File

@ -2,5 +2,5 @@
# Locks the data
# @author Kevin Veen-Birkenbach [aka. Frantz]
DECRYPTED=$(readlink -f "$(dirname "$(readlink -f "${0}")")/../data");
echo "Locking directory: $DECRYPTED"
fusermount -u $DECRYPTED && echo "Data is now encrypted."
echo "Locking directory $DECRYPTED..."
fusermount -u $DECRYPTED && echo "Data is now encrypted." && echo "Removing directory $DECRYPTED..." && rmdir $DECRYPTED

View File

@ -3,5 +3,8 @@
# @author Kevin Veen-Birkenbach [aka. Frantz]
ENCRYPTED=$(readlink -f "$(dirname "$(readlink -f "${0}")")/../.encrypted");
DECRYPTED=$(readlink -f "$(dirname "$(readlink -f "${0}")")/../data");
echo "Unlocking directory: $DECRYPTED"
echo "Unlocking directory $DECRYPTED..."
echo "Creating directory $DECRYPTED..."
mkdir $DECRYPTED
echo "Encrypting directory $DECRYPTED to $DECRYPTED..."
encfs $ENCRYPTED $DECRYPTED && echo "ATTENTION: DATA IS NOW DECRYPTED!"