From 3b59141d88ac174896e3c1d553406f80607646b6 Mon Sep 17 00:00:00 2001 From: Caio Begotti Date: Fri, 6 Feb 2009 15:49:13 +0000 Subject: check for min_disksize devices --- rescue/restore-image.sh | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'rescue') diff --git a/rescue/restore-image.sh b/rescue/restore-image.sh index 5fe7b6417..c167c4e1d 100755 --- a/rescue/restore-image.sh +++ b/rescue/restore-image.sh @@ -86,6 +86,10 @@ function detect_root() dev=$(sed '\|'$restore_media'|!d;s/[0-9] .*$//;s/^.*\///' /proc/mounts) devices=$(grep "^ .*[^0-9]$" < /proc/partitions | grep -v ${dev} | awk '$3 > '$MIN_DISKSIZE' { print $4,$3 }') + if [ -z ${devices} ]; then + exit 1 + fi + devs_found=$(echo $devices | wc -w) # we might use it later again fdisk -l | grep "^/dev/" | grep -v ${dev} > /tmp/fdisk.log -- cgit v1.2.1