From 092be2fee018f26c661d28bd8a0c9e66dc19ee4b Mon Sep 17 00:00:00 2001 From: "Kevin Veen-Birkenbach [aka. Frantz]" Date: Mon, 30 Sep 2019 16:36:34 +0200 Subject: [PATCH] Solved variable bug --- scripts/import-data-from-system.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/import-data-from-system.sh b/scripts/import-data-from-system.sh index db69f32..0e2ace9 100644 --- a/scripts/import-data-from-system.sh +++ b/scripts/import-data-from-system.sh @@ -3,19 +3,20 @@ # @author Kevin Veen-Birkenbach [aka. Frantz] # @param $1 If the first parameter is "reverse" the data will be exported to the system DATA_FOLDER="$(dirname "$(readlink -f "${0}")")/../data"; -BACKUP_LIST=("$HOME/.ssh/") #,"$HOME/.gitconfig"); +declare -a BACKUP_LIST=("$HOME/.ssh/" "$HOME/.gitconfig"); for system_item_path in "${BACKUP_LIST[@]}"; do - data_item_path="$DATA_FOLDER$BACKUP_LIST" + data_item_path="$DATA_FOLDER$system_item_path" if [ "$1" = "reverse" ] then destination="$system_item_path" source="$data_item_path" + echo "Export data from $source to $destination..." else source="$system_item_path" destination="$data_item_path" + echo "Import data from $source to $destination..." fi - echo "Trying to copy data from $source to $destination..." if [ -f "$destination" ] then echo "The destination file allready exists!";