mirror of
https://github.com/kevinveenbirkenbach/linux-image-manager.git
synced 2024-11-22 15:11:04 +01:00
Solved variable bug
This commit is contained in:
parent
edd18db933
commit
092be2fee0
@ -3,19 +3,20 @@
|
|||||||
# @author Kevin Veen-Birkenbach [aka. Frantz]
|
# @author Kevin Veen-Birkenbach [aka. Frantz]
|
||||||
# @param $1 If the first parameter is "reverse" the data will be exported to the system
|
# @param $1 If the first parameter is "reverse" the data will be exported to the system
|
||||||
DATA_FOLDER="$(dirname "$(readlink -f "${0}")")/../data";
|
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[@]}";
|
for system_item_path in "${BACKUP_LIST[@]}";
|
||||||
do
|
do
|
||||||
data_item_path="$DATA_FOLDER$BACKUP_LIST"
|
data_item_path="$DATA_FOLDER$system_item_path"
|
||||||
if [ "$1" = "reverse" ]
|
if [ "$1" = "reverse" ]
|
||||||
then
|
then
|
||||||
destination="$system_item_path"
|
destination="$system_item_path"
|
||||||
source="$data_item_path"
|
source="$data_item_path"
|
||||||
|
echo "Export data from $source to $destination..."
|
||||||
else
|
else
|
||||||
source="$system_item_path"
|
source="$system_item_path"
|
||||||
destination="$data_item_path"
|
destination="$data_item_path"
|
||||||
|
echo "Import data from $source to $destination..."
|
||||||
fi
|
fi
|
||||||
echo "Trying to copy data from $source to $destination..."
|
|
||||||
if [ -f "$destination" ]
|
if [ -f "$destination" ]
|
||||||
then
|
then
|
||||||
echo "The destination file allready exists!";
|
echo "The destination file allready exists!";
|
||||||
|
Loading…
Reference in New Issue
Block a user