[PC-BSD Commits] r3506 - pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts

svn at pcbsd.org svn at pcbsd.org
Mon Feb 23 10:43:03 PST 2009


Author: kris
Date: 2009-02-23 10:43:03 -0800 (Mon, 23 Feb 2009)
New Revision: 3506

Modified:
   pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.FindUpdateParts.sh
Log:

Updated script which detects existing PC-BSD install, fixed a few bugs



Modified: pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.FindUpdateParts.sh
===================================================================
--- pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.FindUpdateParts.sh	2009-02-23 18:28:50 UTC (rev 3505)
+++ pcbsd/trunk/installcd-overlay/usr/local/pcbsd/scripts/PCBSD.FindUpdateParts.sh	2009-02-23 18:43:03 UTC (rev 3506)
@@ -22,29 +22,32 @@
 
   if [ "${FOUNDMNT}" = "1" ]
   then
+   echo "Found: ${i}"
+   PART="${i}"
 
    touch /tmp/TempUMount
 
    # Check for the partitions in fstab, and mount them now
    LIST="d e f g h"
-   for i in $LIST
+   for j in $LIST
    do
-     cat ${FSMNT}/etc/fstab | grep "${PART}${i}" >/dev/null 2>/dev/null
+     cat ${FSMNT}/etc/fstab | grep "${PART}${j}" >/dev/null 2>/dev/null
      if [ "$?" = "0" ]
      then
-       MNT="`cat ${FSMNT}/etc/fstab | grep ${PART}${i} | cut -f 2 | cut -d " " -f 1`" >/dev/null 2>/dev/null
+       MNT="`cat ${FSMNT}/etc/fstab | grep ${PART}${j} | cut -f 2 | cut -d " " -f 1`" >/dev/null 2>/dev/null
 
        # Check for .journal extensions
-       ls ${PART}${i}.journal >/dev/null 2>/dev/null
+       ls ${PART}${j}.journal >/dev/null 2>/dev/null
        if [ "$?" = "0" ]
        then
-         mount ${PART}${i}.journal ${FSMNT}${MNT} >/dev/null 2>/dev/null
+         mount ${PART}${j}.journal ${FSMNT}${MNT} >/dev/null 2>/dev/null
+         echo "umount ${PART}${j}.journal" >> /tmp/TempUMount
        else
-         mount ${PART}${i} ${FSMNT}${MNT} >/dev/null 2>/dev/null
+         mount ${PART}${j} ${FSMNT}${MNT} >/dev/null 2>/dev/null
+         # Save which partition was mounted, so we may unmount it in a bit
+         echo "umount ${PART}${j}" >> /tmp/TempUMount
        fi
        
-       # Save which partition was mounted, so we may unmount it in a bit
-       echo "umount ${FSMNT}${MNT}" >> /tmp/TempUMount
 
      fi
    done



More information about the Commits mailing list