]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/commitdiff
mountdest.sh (RAID) aditional check to prevent overwriting source media
authorArne Fitzenreiter <arne_f@ipfire.org>
Mon, 30 Jun 2008 20:05:02 +0000 (22:05 +0200)
committerArne Fitzenreiter <arne_f@ipfire.org>
Mon, 30 Jun 2008 20:05:02 +0000 (22:05 +0200)
src/install+setup/install/mountdest.sh

index 1810d8ef269bbbbe84edc21ce5e5e71edccacdcd..0d21bbdd6e792b451c84253007c8bbd7ad41ee55 100644 (file)
@@ -63,9 +63,16 @@ for DEVICE in $(kudzu -qps -t 30 -c HD -b RAID | grep device: | cut -d ' ' -f 2
                        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} is source drive - SKIP"
+                           continue
+                       else
+                           echo -n "$DEVICE" > /tmp/dest_device
+                           echo "${DEVICE} - yes, it is our destination"
+                           exit 2
+                       fi
                fi
 done