diff options
author | Olivier Blin <oblin@mandriva.com> | 2008-09-25 19:13:32 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2008-09-25 19:13:32 +0000 |
commit | a8e57f1d5a3d440e68459468fedde1781a061fd7 (patch) | |
tree | 8e32b89dfdd86949c1a838ae07cd9022dad6f428 | |
parent | 8235cf8d86639a1b42d33e8037cf189b725e1616 (diff) | |
download | drakx-backup-do-not-use-a8e57f1d5a3d440e68459468fedde1781a061fd7.tar drakx-backup-do-not-use-a8e57f1d5a3d440e68459468fedde1781a061fd7.tar.gz drakx-backup-do-not-use-a8e57f1d5a3d440e68459468fedde1781a061fd7.tar.bz2 drakx-backup-do-not-use-a8e57f1d5a3d440e68459468fedde1781a061fd7.tar.xz drakx-backup-do-not-use-a8e57f1d5a3d440e68459468fedde1781a061fd7.zip |
support more compression types (from Miura?)
-rwxr-xr-x | rescue/restore-image.sh | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/rescue/restore-image.sh b/rescue/restore-image.sh index 9336b50e6..4e2f06708 100755 --- a/rescue/restore-image.sh +++ b/rescue/restore-image.sh @@ -102,7 +102,14 @@ function detect_root() function write_image() { root=$(detect_root) - bzcat $images_dir/$image | dd of=/dev/$root bs=4096 > /tmp/backup.out 2>&1 & + image=$(cat $images_dir/list | cut -d ',' -f 3) + extension=$(echo $image | cut -d '.' -f 3) + case $extension in + gz) uncomp=zcat ;; + bz2) uncomp=bzcat ;; + *) uncomp=cat ;; + esac + $uncomp $images_dir/$image | dd of=/dev/$root bs=4M > /tmp/backup.out 2>&1 & sleep 3 pid=$(ps ax | grep 'dd of' | grep -v grep | awk '{ print $1 }') |