mirror of
https://github.com/kevinveenbirkenbach/linux-image-manager.git
synced 2025-09-09 19:57:11 +02:00
Added draft for storage encryption procedures
This commit is contained in:
14
scripts/encryption/data/lock.sh
Normal file
14
scripts/encryption/data/lock.sh
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Locks the data
|
||||
# @author Kevin Veen-Birkenbach [aka. Frantz]
|
||||
#
|
||||
# shellcheck disable=SC2015 # Deactivating bool hint
|
||||
# shellcheck source=/dev/null # Deactivate SC1090
|
||||
source "$(dirname "$(readlink -f "${0}")")/../../base.sh" || (echo "Loading base.sh failed." && exit 1)
|
||||
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
|
17
scripts/encryption/data/unlock.sh
Normal file
17
scripts/encryption/data/unlock.sh
Normal file
@@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Unlocks the data
|
||||
# @author Kevin Veen-Birkenbach [aka. Frantz]
|
||||
#
|
||||
# shellcheck source=/dev/null # Deactivate SC1090
|
||||
# shellcheck disable=SC2015 # Deactivating bool hint
|
||||
source "$(dirname "$(readlink -f "${0}")")/../../base.sh" || (echo "Loading base.sh failed." && exit 1)
|
||||
info "Unlocking directory $DECRYPTED_PATH..."
|
||||
if [ ! -d "$DECRYPTED_PATH" ]
|
||||
then
|
||||
info "Creating directory $DECRYPTED_PATH..." &&
|
||||
mkdir "$DECRYPTED_PATH" || error
|
||||
fi
|
||||
info "Encrypting directory $DECRYPTED_PATH to $DECRYPTED_PATH..." &&
|
||||
encfs "$ENCRYPTED_PATH" "$DECRYPTED_PATH" || error
|
||||
echo "ATTENTION: DATA IS NOW DECRYPTED!"
|
Reference in New Issue
Block a user