add customizable backup files list
This commit is contained in:
parent
fc864c3ccf
commit
9f1dab0443
@ -71,9 +71,23 @@ lib/libinterstitial.so
|
||||
lib/libspeech.so
|
||||
lib/libzxing.so
|
||||
etc/hosts
|
||||
etc/custom_backup_list.txt
|
||||
EOF
|
||||
}
|
||||
|
||||
get_custom_files() {
|
||||
local L
|
||||
if [ -f "$C/custom_backup_list.txt" ];
|
||||
then
|
||||
[ ! -f $C/fixed_custom_backup_list.txt ] && tr -d '\r' < $C/custom_backup_list.txt \
|
||||
> $C/fixed_custom_backup_list.txt
|
||||
L=`cat $C/fixed_custom_backup_list.txt`
|
||||
cat <<EOF
|
||||
$L
|
||||
EOF
|
||||
fi
|
||||
}
|
||||
|
||||
backup_file() {
|
||||
if [ -e "$1" ];
|
||||
then
|
||||
@ -126,9 +140,11 @@ case "$1" in
|
||||
then
|
||||
rm -rf $C
|
||||
mkdir -p $C
|
||||
get_files | while read FILE REPLACEMENT; do
|
||||
for file_list in get_files get_custom_files; do
|
||||
$file_list | while read FILE REPLACEMENT; do
|
||||
backup_file $S/$FILE
|
||||
done
|
||||
done
|
||||
fi
|
||||
umount $S
|
||||
;;
|
||||
@ -136,11 +152,13 @@ case "$1" in
|
||||
check_prereq;
|
||||
if [ $PROCEED -ne 0 ];
|
||||
then
|
||||
get_files | while read FILE REPLACEMENT; do
|
||||
for file_list in get_files get_custom_files; do
|
||||
$file_list | while read FILE REPLACEMENT; do
|
||||
R=""
|
||||
[ -n "$REPLACEMENT" ] && R="$S/$REPLACEMENT"
|
||||
restore_file $S/$FILE $R
|
||||
done
|
||||
done
|
||||
rm -rf $C
|
||||
fi
|
||||
;;
|
||||
|
Loading…
Reference in New Issue
Block a user