Changeset 3433 in MondoRescue for branches/3.2


Ignore:
Timestamp:
Aug 28, 2015, 3:19:06 PM (9 years ago)
Author:
Bruno Cornec
Message:
  • Fix the move of NIC when booting with PXE and that the card was renumbered (useing only uppercases MAC addresses for comparison)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/mindi/rootfs/usr/sbin/start-netfs

    r3279 r3433  
    1212# Get info from config file
    1313ipdev=`grep netfs-dev /tmp/mondorestore.cfg 2> /dev/null | cut -d' ' -f2-`
    14 hwaddr=`grep netfs-client-hwaddr /tmp/mondorestore.cfg 2> /dev/null | cut -d' ' -f2-`
     14# MAC address in uppercases
     15hwaddr=`grep netfs-client-hwaddr /tmp/mondorestore.cfg 2> /dev/null | cut -d' ' -f2- | perl -nle 'print uc;'`
    1516ipaddress=`grep netfs-client-ipaddr /tmp/mondorestore.cfg 2> /dev/null | cut -d' ' -f2-`
    1617ipnetmask=`grep netfs-client-netmask /tmp/mondorestore.cfg 2> /dev/null | cut -d' ' -f2-`
     
    3536for i in `cat /proc/cmdline` ; do
    3637    echo $i | grep -qi ping= && ipcount=`echo $i | cut -d= -f2`
    37     echo $i | grep -qi hwaddr= && hwaddr=`echo $i | cut -d= -f2`
     38    echo $i | grep -qi hwaddr= && hwaddr=`echo $i | cut -d= -f2  | perl -nle 'print uc;'`
    3839    echo $i | grep -qi ipconf= && ipconf=`echo $i | cut -d= -f2`
    3940    echo $i | grep -qi netfsmount= && export netfsmount=`echo $i | cut -d= -f2`
     
    7172        # If same system, map to the right MAC address
    7273        if [ "$hwaddr" != "" ]; then
    73             hwaddr_found=`ifconfig $ipdev | grep HWaddr | awk '{print $NF}'`
     74            hwaddr_found=`ifconfig $ipdev | grep HWaddr | awk '{print $NF}' | perl -nle 'print uc;'`
    7475            if [ "$hwaddr" != "$hwaddr_found" ]; then
    75                 ipdev_new=`ifconfig -a | grep $hwaddr | awk '{print $1}'`
     76                ipdev_new=`ifconfig -a | grep -i $hwaddr | awk '{print $1}'`
    7677                if [ "$ipdev_new" != "" ]; then
    77                     LogIt "Interface $ipdev changed to $ipdev_new (MAC: $hwaddr)"
     78                    LogIt "Interface with MAC address $hwaddr changed from $ipdev to $ipdev_new"
     79                    LogIt "Using $ipdev_new for network configuration from now on"
    7880                    ipdev=$ipdev_new
    7981                else
Note: See TracChangeset for help on using the changeset viewer.