From 3467440f8cec3a786e38ad4c3c8b691fe103faf7 Mon Sep 17 00:00:00 2001 From: Caio Begotti Date: Mon, 10 Nov 2008 19:42:21 +0000 Subject: actually i believe that's a better fix as it's handled by the function which called detect_root, otherwise we'd be trapped and would not see the error and root would still be empty for write_image --- rescue/restore-image.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/rescue/restore-image.sh b/rescue/restore-image.sh index 3776f9222..a5021bdbd 100755 --- a/rescue/restore-image.sh +++ b/rescue/restore-image.sh @@ -93,14 +93,18 @@ function detect_root() else _msgbox "\nError writing image: disk device not detected.\n" fi - else - _msgbox "\nError writing image: disk device not detected.\n" fi } function write_image() { root=$(detect_root) + if [ -z ${root} ]; then + _msgbox "\nError writing image: disk device not detected.\n" + # so that netbooks using USB sticks as disks can retry (like Gdium) + welcome + fi + image=$(cat $images_dir/list | cut -d ',' -f 3) extension=$(echo $image | cut -d '.' -f 3) case $extension in -- cgit v1.2.1