Implemented encryption mechanism for data

This commit is contained in:
Kevin Veen-Birkenbach [aka. Frantz]
2019-09-30 17:19:27 +02:00
parent affcc26512
commit dc72bd5d31
8 changed files with 40 additions and 17 deletions

View File

@@ -3,6 +3,11 @@
# @author Kevin Veen-Birkenbach [aka. Frantz]
# @param $1 If the first parameter is "reverse" the data will be exported to the system
DATA_FOLDER=$(readlink -f "$(dirname "$(readlink -f "${0}")")/../data");
if [ -z $(mount | grep $DATA_FOLDER) ]
then
echo "The data folder $DATA_FOLDER is locked. You need to unlock it!"
bash "$(dirname "$(readlink -f "${0}")")/unlock.sh" || exit 1;
fi
declare -a BACKUP_LIST=("$HOME/.ssh/" "$HOME/.gitconfig");
for system_item_path in "${BACKUP_LIST[@]}";
do
@@ -31,11 +36,11 @@ do
cp -vi "$source" "$destination"
else
if [ -d "$source" ]
then
echo "Copy data from directory $source to directory $destination_dir..."
cp -vir "$source" "$destination_dir"
else
echo "$source doesn't exist. Copying data is not possible."
fi
then
echo "Copy data from directory $source to directory $destination_dir..."
cp -vir "$source" "$destination_dir"
else
echo "$source doesn't exist. Copying data is not possible."
fi
fi
done