diff options
author | Kali- <kalimero@ngi.it> | 2010-08-14 23:46:34 +0200 |
---|---|---|
committer | Steve Kondik <shade@chemlab.org> | 2010-08-16 17:35:10 -0400 |
commit | 9f1dab044326c15f9f95e6fc3551ddf890553eac (patch) | |
tree | 662206eb5bd6cac4c2f7c67d6cf5e2646aeabeec /prebuilt/common | |
parent | fc864c3ccf45c44e85455b9a16675821b021cfd0 (diff) | |
download | vendor_replicant-9f1dab044326c15f9f95e6fc3551ddf890553eac.zip vendor_replicant-9f1dab044326c15f9f95e6fc3551ddf890553eac.tar.gz vendor_replicant-9f1dab044326c15f9f95e6fc3551ddf890553eac.tar.bz2 |
add customizable backup files list
Diffstat (limited to 'prebuilt/common')
-rwxr-xr-x | prebuilt/common/bin/backuptool.sh | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/prebuilt/common/bin/backuptool.sh b/prebuilt/common/bin/backuptool.sh index f251301..1340b41 100755 --- a/prebuilt/common/bin/backuptool.sh +++ b/prebuilt/common/bin/backuptool.sh @@ -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,8 +140,10 @@ case "$1" in then rm -rf $C mkdir -p $C - get_files | while read FILE REPLACEMENT; do - backup_file $S/$FILE + 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,10 +152,12 @@ case "$1" in check_prereq; if [ $PROCEED -ne 0 ]; then - get_files | while read FILE REPLACEMENT; do - R="" - [ -n "$REPLACEMENT" ] && R="$S/$REPLACEMENT" - restore_file $S/$FILE $R + 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 |