Add a source check for fdd-image to mountdest.sh
authorArne Fitzenreiter <arne_f@ipfire.org>
Fri, 22 May 2009 09:29:45 +0000 (11:29 +0200)
committerArne Fitzenreiter <arne_f@ipfire.org>
Fri, 22 May 2009 09:29:45 +0000 (11:29 +0200)
src/install+setup/install/mountdest.sh

index 6af2b4567501e64296c4ecbdb61176eeb7fc9953..d1ce89b12e3ca0a1b6f65dc0a91a9606033e0848 100644 (file)
@@ -27,7 +27,7 @@ for DEVICE in $(kudzu -qps -t 30 -c HD -b IDE | grep device: | cut -d ' ' -f 2 |
                mount /dev/${DEVICE}1 /harddisk 2> /dev/null
                if [ -n "$(ls /harddisk/ipfire-*.tbz2 2>/dev/null)" ]; then
                        umount /harddisk 2> /dev/null
-                       echo "${DEVICE} is source drive - SKIP"
+                       echo "${DEVICE}1 is source drive - SKIP"
                        continue
                else
                        umount /harddisk 2> /dev/null
@@ -47,7 +47,7 @@ for DEVICE in $(kudzu -qps -t 30 -c HD -b SCSI | grep device: | cut -d ' ' -f 2
                        continue
                else
                        umount /harddisk 2> /dev/null
-                       mount /dev/${DEVICE}1 /harddisk 2> /dev/null
+                       mount /dev/${DEVICE}1 /harddisk 2> /dev/null
                        if [ -n "$(ls /harddisk/ipfire-*.tbz2 2>/dev/null)" ]; then
                                umount /harddisk 2> /dev/null
                                echo "${DEVICE}1 is source drive - SKIP"
@@ -67,19 +67,27 @@ for DEVICE in $(kudzu -qps -t 30 -c HD -b RAID | grep device: | cut -d ' ' -f 2
                mount /dev/${DEVICE}p1 /harddisk 2> /dev/null
                if [ -n "$(ls /harddisk/ipfire-*.tbz2 2>/dev/null)" ]; then
                        umount /harddisk 2> /dev/null
-                       echo "${DEVICE} is source drive - SKIP"
+                       echo "${DEVICE}p1 is source drive - SKIP"
                        continue
                else
                        umount /harddisk 2> /dev/null
                        mount /dev/${DEVICE}1 /harddisk 2> /dev/null
                        if [ -n "$(ls /harddisk/ipfire-*.tbz2 2>/dev/null)" ]; then
-                           umount /harddisk 2> /dev/null
-                           echo "${DEVICE} is source drive - SKIP"
-                           continue
+                               umount /harddisk 2> /dev/null
+                               echo "${DEVICE}1 is source drive - SKIP"
+                               continue
                        else
-                           echo -n "$DEVICE" > /tmp/dest_device
-                           echo "${DEVICE} - yes, it is our destination"
-                           exit 2
+                               umount /harddisk 2> /dev/null
+                               mount /dev/${DEVICE} /harddisk 2> /dev/null
+                               if [ -n "$(ls /harddisk/ipfire-*.tbz2 2>/dev/null)" ]; then
+                                       umount /harddisk 2> /dev/null
+                                       echo "${DEVICE} is source drive - SKIP"
+                                       continue
+                               else
+                                       echo -n "$DEVICE" > /tmp/dest_device
+                                       echo "${DEVICE} - yes, it is our destination"
+                                       exit 2
+                               fi
                        fi
                fi
 done