Changeset 618 in MondoRescue for trunk/mondo/mondo/common/libmondo-files.c


Ignore:
Timestamp:
Jun 3, 2006, 12:16:18 AM (14 years ago)
Author:
bcornec
Message:

merge -r 591:617 $SVN_M/branches/stable

File:
1 edited

Legend:

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

    r507 r618  
    11491149    fprintf(fout, "done\n");
    11501150    fprintf(fout, "ifconfig lo 127.0.0.1  # config loopback\n");
     1151    fprintf(fout, "ipdev=%s\n", nfs_dev);
    11511152    fprintf(fout, "ipaddress=%s\n", nfs_client_ipaddr);
    11521153    fprintf(fout, "ipnetmask=%s\n", nfs_client_netmask);
     
    11571158    fprintf(fout, "    echo $i | grep -qi ipconf= && ipconf=`echo $i | cut -d= -f2`\n");
    11581159    fprintf(fout, "done\n");
    1159     fprintf(fout, "if [ \"$ipconf\" = \"dhcp\" ]; then\n");
    1160     fprintf(fout, "    udhcpc -i %s\n", nfs_dev);
     1160    fprintf(fout, "grep -q \"dhcp\" \"$ipconf\"\n");
     1161    fprintf(fout, "if [ $? = 0 ]; then\n");
     1162    fprintf(fout, "    ipdev=`echo $ipconf | cut -d: -f1`\n");
     1163    fprintf(fout, "    udhcpc -i $ipdev\n", );
    11611164    fprintf(fout, "else\n");
    11621165    fprintf(fout, "    if [ \"$ipconf\" != \"\" ]; then\n");
    1163     fprintf(fout, "        ipaddress=`echo $ipconf | cut -d: -f1`\n");
    1164     fprintf(fout, "        ipnetmask=`echo $ipconf | cut -d: -f2`\n");
    1165     fprintf(fout, "        ipbroadcast=`echo $ipconf | cut -d: -f3`\n");
    1166     fprintf(fout, "        ipgateway=`echo $ipconf | cut -d: -f4`\n");
     1166    fprintf(fout, "        ipdev=`echo $ipconf | cut -d: -f1`\n");
     1167    fprintf(fout, "        ipaddress=`echo $ipconf | cut -d: -f2`\n");
     1168    fprintf(fout, "        ipnetmask=`echo $ipconf | cut -d: -f3`\n");
     1169    fprintf(fout, "        ipbroadcast=`echo $ipconf | cut -d: -f4`\n");
     1170    fprintf(fout, "        ipgateway=`echo $ipconf | cut -d: -f5`\n");
    11671171    fprintf(fout, "    fi\n");
    1168     fprintf(fout, "    ifconfig %s $ipaddress netmask $ipnetmask broadcast $ipbroadcast\n", nfs_dev);
     1172    fprintf(fout, "    ifconfig $ipdev $ipaddress netmask $ipnetmask broadcast $ipbroadcast\n");
    11691173    fprintf(fout, "    route add default gw $ipgateway\n");
    11701174    fprintf(fout, "fi\n");
Note: See TracChangeset for help on using the changeset viewer.