summaryrefslogtreecommitdiffstats
path: root/rescue/restore-image.sh
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2008-09-25 19:08:40 +0000
committerOlivier Blin <oblin@mandriva.com>2008-09-25 19:08:40 +0000
commit8235cf8d86639a1b42d33e8037cf189b725e1616 (patch)
tree439dd94d0f21100a1144572aa6e3cd6a0eb22e38 /rescue/restore-image.sh
parent8c1c92d93d05604552275f4c74b905bf569c3878 (diff)
downloaddrakx-backup-do-not-use-8235cf8d86639a1b42d33e8037cf189b725e1616.tar
drakx-backup-do-not-use-8235cf8d86639a1b42d33e8037cf189b725e1616.tar.gz
drakx-backup-do-not-use-8235cf8d86639a1b42d33e8037cf189b725e1616.tar.bz2
drakx-backup-do-not-use-8235cf8d86639a1b42d33e8037cf189b725e1616.tar.xz
drakx-backup-do-not-use-8235cf8d86639a1b42d33e8037cf189b725e1616.zip
do not ask if only one device is found (from Miura?)
Diffstat (limited to 'rescue/restore-image.sh')
-rwxr-xr-xrescue/restore-image.sh32
1 files changed, 19 insertions, 13 deletions
diff --git a/rescue/restore-image.sh b/rescue/restore-image.sh
index 8e5567d0a..9336b50e6 100755
--- a/rescue/restore-image.sh
+++ b/rescue/restore-image.sh
@@ -76,20 +76,26 @@ function detect_root()
dev=$(sed '/\/tmp\/media/!d;s/[0-9] .*$//;s/^.*\///' /proc/mounts)
devices=$(grep "^ .*[^0-9]$" < /proc/partitions | grep -v ${dev} | awk '{ print $4,$3 }')
- if [ ! -z ${dev} ]; then
- opcao=$(dialog --backtitle "$BACKTITLE" --title "$TITLE" --stdout --menu 'Choose one of the detected devices to restore to (check the blocks size column first):' 8 50 0 $devices )
- if [ "$?" != "0" ]; then
- _yesno "\nInterrupt installation?\n "
- if [ "$?" = "0" ]; then
- _shutdown
- fi
- else
- root=$opcao
- fi
-
- echo "$root"
+ devs_found=$(echo $devices | wc -w)
+ if [ "$devs_found" -gt "2" ]; then
+ if [ ! -z ${dev} ]; then
+ opcao=$(dialog --backtitle "$BACKTITLE" --title "$TITLE" --stdout --menu 'Choose one of the detected devices to restore to (check the blocks size column first):' 8 50 0 $devices )
+ if [ "$?" != "0" ]; then
+ _yesno "\nInterrupt installation?\n "
+ if [ "$?" = "0" ]; then
+ _shutdown
+ fi
+ else
+ root=$opcao
+ fi
+
+ echo "$root"
+ else
+ _msgbox "\nError writing image: disk device not detected\n"
+ fi
else
- _msgbox "\nError writing image: disk device not detected\n"
+ root=$(echo $devices | cut -d ' ' -f 1)
+ echo "$root"
fi
}