2019-09-30 17:19:27 +02:00
|
|
|
#!/bin/bash
|
2019-10-01 11:59:31 +02:00
|
|
|
#
|
2019-09-30 17:19:27 +02:00
|
|
|
# Unlocks the data
|
|
|
|
# @author Kevin Veen-Birkenbach [aka. Frantz]
|
2019-10-01 11:59:31 +02:00
|
|
|
#
|
2019-10-01 12:30:27 +02:00
|
|
|
# shellcheck source=/dev/null # Deactivate SC1090
|
2020-05-05 11:50:20 +02:00
|
|
|
# shellcheck disable=SC2015 # Deactivating bool hint
|
2020-05-20 10:35:37 +02:00
|
|
|
source "$(dirname "$(readlink -f "${0}")")/../../base.sh" || (echo "Loading base.sh failed." && exit 1)
|
2020-05-03 20:36:49 +02:00
|
|
|
info "Unlocking directory $DECRYPTED_PATH..."
|
2019-10-02 16:51:08 +02:00
|
|
|
if [ ! -d "$DECRYPTED_PATH" ]
|
|
|
|
then
|
2020-05-03 20:36:49 +02:00
|
|
|
info "Creating directory $DECRYPTED_PATH..." &&
|
2020-05-15 11:18:19 +02:00
|
|
|
mkdir "$DECRYPTED_PATH" || error
|
2019-10-02 16:51:08 +02:00
|
|
|
fi
|
2020-05-03 20:36:49 +02:00
|
|
|
info "Encrypting directory $DECRYPTED_PATH to $DECRYPTED_PATH..." &&
|
2020-05-15 11:18:19 +02:00
|
|
|
encfs "$ENCRYPTED_PATH" "$DECRYPTED_PATH" || error
|
2020-05-03 20:36:49 +02:00
|
|
|
echo "ATTENTION: DATA IS NOW DECRYPTED!"
|