Changeset 739 in MondoRescue for branches/stable/mindi/mindi


Ignore:
Timestamp:
Aug 4, 2006, 11:54:47 AM (18 years ago)
Author:
Bruno Cornec
Message:

Fix bug in start-nfs: $ needs to be escaped in that env.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mindi/mindi

    r735 r739  
    14451445            items=0
    14461446            for i in `tr -s ' ' '\t' < /proc/swaps | grep -Fv "Filename" | cut -f3` ; do
    1447             totalsize=$(($totalsize+$i))
    1448             items=$(($items+1))
     1447                totalsize=$(($totalsize+$i))
     1448                items=$(($items+1))
    14491449            done
    1450                     [ "$items" -gt "0" ] && partition_size=$(($totalsize/$items)) || partition_size=0
     1450            [ "$items" -gt "0" ] && partition_size=$(($totalsize/$items)) || partition_size=0
    14511451            [ "$partition_size" -lt "125000" ] && partition_size=125000
    14521452            echo "I'm guessing $c_p is $(($partition_size/1024))MB" >> $LOGFILE
     
    14581458    if [ "$partition_mountpt" = "" ] ; then
    14591459        if [ "`pvdisplay $current_lvolume 2> /dev/null`" != "" ] || [ "`lvm pvdisplay $current_lvolume 2> /dev/null`" != "" ] ; then
    1460         if  [ "`grep -F device /etc/raidtab 2> /dev/null | grep -w $current_partition`" ] ; then
    1461             partition_mountpt="raid"
    1462             partition_format="raid"
    1463         else
    1464 #           lvm_dev="`pvdisplay $current_lvolume | grep -i "VG N" | head -n1 | tr -s ' ' ' ' | cut -d' ' -f3`"
    1465             partition_mountpt="lvm"
    1466             partition_format="lvm"
    1467         fi
     1460            if  [ "`grep -F device /etc/raidtab 2> /dev/null | grep -w $current_partition`" ] ; then
     1461                partition_mountpt="raid"
     1462                partition_format="raid"
     1463            else
     1464#               lvm_dev="`pvdisplay $current_lvolume | grep -i "VG N" | head -n1 | tr -s ' ' ' ' | cut -d' ' -f3`"
     1465                partition_mountpt="lvm"
     1466                partition_format="lvm"
     1467            fi
    14681468        fi
    14691469    fi
     
    14731473    if [ "`echo " $IMAGE_DEVS " | grep -F " $current_partition "`" != "" ] ; then
    14741474        partition_mountpt="image"
    1475             old_partition_fmt=$partition_format
     1475        old_partition_fmt=$partition_format
    14761476#       partition_format="`$FDISK -l 2>> $LOGFILE | tr -s '\t' ' ' | grep -w "$absolute_partition" | $AWK 'x=$(NF-1}'`"
    14771477        partition_format="`$FDISK -l 2>> $LOGFILE | tr '*' ' ' | tr '+' ' ' | tr -s ' ' '\t' | grep -w "$absolute_partition" | cut -f5`"
    1478             echo "------- $FDISK -l log ------------" >> $LOGFILE
    1479             cat $FDISKLOG >> $LOGFILE
    1480             echo "------- $FDISK log end ------------" >> $LOGFILE
     1478        echo "------- $FDISK -l log ------------" >> $LOGFILE
     1479        cat $FDISKLOG >> $LOGFILE
     1480        echo "------- $FDISK log end ------------" >> $LOGFILE
    14811481        partition_size=$(($partition_size+1)); # just in case
    1482             if [ "$partition_format" = "Linux" ] ; then
    1483                 echo "Are you imaging a mounted swap partition? Silly..." >> $LOGFILE
    1484                 echo "Reverting format from $old_partition_fmt to $partition_format" >> $LOGFILE
    1485                 partition_format=$old_partition_fmt
    1486             fi
    1487     fi
    1488         if [ "$EXCLUDE_DEVS" ] && [ "`echo " $EXCLUDE_DEVS " | grep -F " $current_partition "`" ] || [ "`echo " $EXCLUDE_DEVS " | grep " $current_partition "`" ] ; then
    1489             echo "Excluding $current_partition from mountlist" >> $LOGFILE
    1490             continue
    1491         fi
    1492         if [ ! "$partition_mountpt" ] ; then
     1482        if [ "$partition_format" = "Linux" ] ; then
     1483            echo "Are you imaging a mounted swap partition? Silly..." >> $LOGFILE
     1484            echo "Reverting format from $old_partition_fmt to $partition_format" >> $LOGFILE
     1485            partition_format=$old_partition_fmt
     1486        fi
     1487    fi
     1488    if [ "$EXCLUDE_DEVS" ] && [ "`echo " $EXCLUDE_DEVS " | grep -F " $current_partition "`" ] || [ "`echo " $EXCLUDE_DEVS " | grep " $current_partition "`" ] ; then
     1489        echo "Excluding $current_partition from mountlist" >> $LOGFILE
     1490        continue
     1491    fi
     1492    if [ ! "$partition_mountpt" ] ; then
    14931493        for qq in "" `find /dev/ida/c*d* ! -name '*p*'` ; do
    1494         partition_format=`$FDISK -l $qq 2>> $LOGFILE | grep -w "$c_p" | sed 's/12/|/' | tr -s '\t' ' ' | cut -d'|' -f2 | cut -d' ' -f2-9`
    1495                 echo "------- $FDISK -l $qq log ------------" >> $LOGFILE
    1496                 cat $FDISKLOG >> $LOGFILE
    1497                 echo "------- $FDISK log end ------------" >> $LOGFILE
    1498         [ "$partition_format" ] && break
     1494            partition_format=`$FDISK -l $qq 2>> $LOGFILE | grep -w "$c_p" | sed 's/12/|/' | tr -s '\t' ' ' | cut -d'|' -f2 | cut -d' ' -f2-9`
     1495            echo "------- $FDISK -l $qq log ------------" >> $LOGFILE
     1496            cat $FDISKLOG >> $LOGFILE
     1497            echo "------- $FDISK log end ------------" >> $LOGFILE
     1498            [ "$partition_format" ] && break
    14991499        done
    15001500        if [ "$partition_format" = "Compaq diagnostics" ] ; then
    1501         partition_format="compaq"
     1501            partition_format="compaq"
    15021502        elif [ ! "`grep -F device /etc/raidtab 2> /dev/null | grep -w $current_partition`" ] ; then
    1503         LogIt "Unable to find mountpoint of $current_partition - ignoring\n"
    1504         continue
     1503            LogIt "Unable to find mountpoint of $current_partition - ignoring\n"
     1504            continue
    15051505        fi
    15061506    fi
     
    15191519            echo "Unknown mountpoint (outstring = $unofficial_outstring)" >> $LOGFILE
    15201520        fi
    1521         elif [ "$partition_format" = "" ] ; then
     1521    elif [ "$partition_format" = "" ] ; then
    15221522        echo "Unknown format (outstring = $unofficial_outstring)" >> $LOGFILE
    15231523    elif [ "$partition_size" = "" ] ; then
     
    15261526        continue
    15271527    else
    1528             if [ "$partition_format" = "dos" ] || [ "$partition_format" = "msdos" ] ; then
    1529                 echo "Stupid bastard..." >> $LOGFILE
    1530                 partition_format="vfat"
    1531             fi
     1528        if [ "$partition_format" = "dos" ] || [ "$partition_format" = "msdos" ] ; then
     1529            echo "Stupid bastard..." >> $LOGFILE
     1530            partition_format="vfat"
     1531        fi
    15321532        printf "\t%-15s %-15s %-15s %7s %-15s\n" $current_partition $partition_mountpt $partition_format $psz "$redhat_label"
    15331533        printf "%s %s %s %s %s\n" $current_partition $partition_mountpt $partition_format $partition_size "$redhat_label" >> $mountlist
Note: See TracChangeset for help on using the changeset viewer.