]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - src/install+setup/install/mountdest.sh
Add a source check for fdd-image to mountdest.sh
[people/pmueller/ipfire-2.x.git] / src / install+setup / install / mountdest.sh
index 1810d8ef269bbbbe84edc21ce5e5e71edccacdcd..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
@@ -40,16 +40,24 @@ done
 # scan USB/SCSI devices
 echo "--> USB/SCSI"
 for DEVICE in $(kudzu -qps -t 30 -c HD -b SCSI | grep device: | cut -d ' ' -f 2 | sort | uniq); do
-               mount /dev/${DEVICE}1 /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
                        umount /harddisk 2> /dev/null
-                       echo -n "$DEVICE" > /tmp/dest_device
-                       echo "${DEVICE} - yes, it is our destination"
-                       exit 1
+                       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"
+                               continue
+                       else
+                               umount /harddisk 2> /dev/null
+                               echo -n "$DEVICE" > /tmp/dest_device
+                               echo "${DEVICE} - yes, it is our destination"
+                               exit 1
+                       fi
                fi
 done
 
@@ -59,13 +67,28 @@ 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
-                       echo -n "$DEVICE" > /tmp/dest_device
-                       echo "${DEVICE} - yes, it is our destination"
-                       exit 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}1 is source drive - SKIP"
+                               continue
+                       else
+                               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