Changeset 610 in MondoRescue for branches/stable/mondo


Ignore:
Timestamp:
Jun 2, 2006, 11:45:53 PM (18 years ago)
Author:
bcornec
Message:

CAUTION: This patch breaks the PXE interface through the ipconf option
It adds thepossibility to precise the NIC name through ipconf as first parameter.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/mondo/mondo/common/libmondo-files.c

    r541 r610  
    12791279    fprintf(fout, "done\n");
    12801280    fprintf(fout, "ifconfig lo 127.0.0.1  # config loopback\n");
     1281    fprintf(fout, "ipdev=%s\n", nfs_dev);
    12811282    fprintf(fout, "ipaddress=%s\n", nfs_client_ipaddr);
    12821283    fprintf(fout, "ipnetmask=%s\n", nfs_client_netmask);
     
    12871288    fprintf(fout, "    echo $i | grep -qi ipconf= && ipconf=`echo $i | cut -d= -f2`\n");
    12881289    fprintf(fout, "done\n");
    1289     fprintf(fout, "if [ \"$ipconf\" = \"dhcp\" ]; then\n");
    1290     fprintf(fout, "    udhcpc -i %s\n", nfs_dev);
     1290    fprintf(fout, "grep -q \"dhcp\" \"$ipconf\"\n");
     1291    fprintf(fout, "if [ $? = 0 ]; then\n");
     1292    fprintf(fout, "    ipdev=`echo $ipconf | cut -d: -f1`\n");
     1293    fprintf(fout, "    udhcpc -i $ipdev\n", );
    12911294    fprintf(fout, "else\n");
    12921295    fprintf(fout, "    if [ \"$ipconf\" != \"\" ]; then\n");
    1293     fprintf(fout, "        ipaddress=`echo $ipconf | cut -d: -f1`\n");
    1294     fprintf(fout, "        ipnetmask=`echo $ipconf | cut -d: -f2`\n");
    1295     fprintf(fout, "        ipbroadcast=`echo $ipconf | cut -d: -f3`\n");
    1296     fprintf(fout, "        ipgateway=`echo $ipconf | cut -d: -f4`\n");
     1296    fprintf(fout, "        ipdev=`echo $ipconf | cut -d: -f1`\n");
     1297    fprintf(fout, "        ipaddress=`echo $ipconf | cut -d: -f2`\n");
     1298    fprintf(fout, "        ipnetmask=`echo $ipconf | cut -d: -f3`\n");
     1299    fprintf(fout, "        ipbroadcast=`echo $ipconf | cut -d: -f4`\n");
     1300    fprintf(fout, "        ipgateway=`echo $ipconf | cut -d: -f5`\n");
    12971301    fprintf(fout, "    fi\n");
    1298     fprintf(fout, "    ifconfig %s $ipaddress netmask $ipnetmask broadcast $ipbroadcast\n", nfs_dev);
     1302    fprintf(fout, "    ifconfig $ipdev $ipaddress netmask $ipnetmask broadcast $ipbroadcast\n");
    12991303    fprintf(fout, "    route add default gw $ipgateway\n");
    13001304    fprintf(fout, "fi\n");
Note: See TracChangeset for help on using the changeset viewer.