Changeset 1314 for branches/2.2.2/mondo


Ignore:
Timestamp:
Apr 16, 2007, 3:16:24 PM (13 years ago)
Author:
bruno
Message:

label-partitions-as-necessary should now work correctly for LABEL and UUID (grep -w removed)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.2/mondo/src/restore-scripts/mondo/label-partitions-as-necessary

    r1295 r1314  
    77
    88read_partition_line() {
    9     local tmp label mountpt command format
     9    local label mountpt command format
    1010
    11     if [ "`echo "$1" | grep -E 'LABEL='`" != "" ] ; then
     11    label=`echo "$1" | awk '{print $1}' | cut -d'=' -f2`
     12    format=`echo "$1" | awk '{print $3}'`
     13
     14    if [ "`echo "$1" | grep -E 'LABEL='`" != "" ] ; then
    1215        opttun="-L"
    13     elif [ "`echo "$1" | grep -E 'UUID='`" != "" ] ; then
     16        mountpt=`awk '{print $1,$5}' $mountlist | grep " $label$" | awk '{print $1}'`
     17    elif [ "`echo "$1" | grep -E 'UUID='`" != "" ] ; then
    1418        opttun="-U"
     19        mountpt=`awk '{print $1,$6}' $mountlist | grep " $label$" | awk '{print $1}'`
    1520    else
    1621        # Nothing to do
    1722        return
    18     fi
     23    fi
    1924
    20     tmp=`echo "$1" | tr -s ' ' '\t' | cut -f1`
    21     label=`echo "$tmp" | cut -d'=' -f2`
    22     format=`echo "$1" | tr -s ' ' '\t' | cut -f3`
    23     mountpt=`grep -w " $label" $mountlist | cut -d' ' -f1`
    2425    if [ ! "$mountpt" ] ; then
    25         LogIt "Not labeling anything as $label because $mountpt is not a mountpoint"
     26        LogIt "Not labeling anything as ($label) because ($mountpt) is not a mountpoint"
    2627    elif [ ! "$label" ] ; then
    27         LogIt "Not labeling $mountpt as anything because $label is not a label"
     28        LogIt "Not labeling ($mountpt) as anything because ($label) is not a label"
    2829    else
    2930        if [ "$format" = "ext2" ] || [ "$format" = "ext3" ] ; then
Note: See TracChangeset for help on using the changeset viewer.