summaryrefslogtreecommitdiffstats
path: root/rescue/restore-image.sh
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2009-02-11 17:05:09 +0000
committerOlivier Blin <oblin@mandriva.com>2009-02-11 17:05:09 +0000
commit1d19a5d8d6740cf5a7bb1cea5c3d349f20e13169 (patch)
tree70c32040a1a4ba8524f33f6c66389a759d4ec704 /rescue/restore-image.sh
parentefc349407fb3d6ee949aaff77e8fbe297ff2750c (diff)
downloaddrakx-1d19a5d8d6740cf5a7bb1cea5c3d349f20e13169.tar
drakx-1d19a5d8d6740cf5a7bb1cea5c3d349f20e13169.tar.gz
drakx-1d19a5d8d6740cf5a7bb1cea5c3d349f20e13169.tar.bz2
drakx-1d19a5d8d6740cf5a7bb1cea5c3d349f20e13169.tar.xz
drakx-1d19a5d8d6740cf5a7bb1cea5c3d349f20e13169.zip
fix passing &>/dev/null to dd command (it is not interpreted by shell if in string)
Diffstat (limited to 'rescue/restore-image.sh')
-rwxr-xr-xrescue/restore-image.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/rescue/restore-image.sh b/rescue/restore-image.sh
index ad4797944..3c3d6f5e8 100755
--- a/rescue/restore-image.sh
+++ b/rescue/restore-image.sh
@@ -250,12 +250,13 @@ function write_image()
*) uncomp=cat ;;
esac
+ skipstart=/bin/true
if [ -n "$win32_part_dev" ]; then
- skipstart='dd of=/dev/null bs=1 count=32256 &>/dev/null;'
+ skipstart='dd of=/dev/null bs=1 count=32256'
fi
# the actual dumping command, from image to disk
- ${uncomp} ${images_dir}/${image} | (${skipstart} dd bs=4M of=/dev/${root} >/tmp/backup.out 2>&1>>/tmp/log) &
+ ${uncomp} ${images_dir}/${image} | (${skipstart} &>/dev/null; dd bs=4M of=/dev/${root} >/tmp/backup.out 2>&1>>/tmp/log) &
sleep 3
pid=$(ps ax | grep 'dd bs=4M of' | grep -v grep | awk '{ print $1 }')