Ticket #320: dhcp-hosts-fix-2.patch

File dhcp-hosts-fix-2.patch, 1.7 KB (added by DJ Lucas, 21 years ago)

forgot to copy the original file and edit.

  • connect/dhcp/bootscripts.xml

    diff -Naur BOOK-ORIG/connect/dhcp/bootscripts.xml BOOK-DJL/connect/dhcp/bootscripts.xml
    old new  
    4848echo "Bringing up the eth0 interface..."
    4949modprobe eth0
    5050loadproc $DHCP_PROG $DHCP_START
     51
     52echo "Setting up the /etc/hosts file..."
     53
     54IPADDR=`ifconfig eth0 | \
     55grep "inet addr" | cut -f 2 -d ":" | cut -f 1 -d " "`
     56
     57sed "s/0.0.0.0/$IPADDR/" \
     58    /etc/sysconfig/network-devices/hosts.dhcp > /etc/hosts
     59evaluate_retval
     60
    5161<userinput>EOF</userinput></screen></para>
    5262
    5363<para>Then the <filename>ifdown-eth0</filename> script:</para>
     
    6474evaluate_retval
    6575<userinput>EOF</userinput></screen></para>
    6676
    67 <para>Finally, we need to make these scripts executable:</para>
     77<para>Next, we need to make these scripts executable:</para>
    6878
    6979<para><screen><userinput>chmod 755 /etc/sysconfig/network-devices/ifup-eth0 &amp;&amp;
    7080chmod 755 /etc/sysconfig/network-devices/ifdown-eth0</userinput></screen></para>
    7181
     82<para>Finally, we need to copy your current <userinput>/etc/hosts</userinput>
     83file to another location, and then edit it so that the script can correct the
     84IP address in the original file on bootup.</para>
     85
     86<para><screen><userinput>cp /etc/hosts /etc/sysconfig/network-devices/hosts.dhcp</userinput></screen></para>
     87
     88<para>Now start your favorite editor, and open
     89<userinput>/etc/sysconfig/network-devices/hosts.dhcp</userinput>.   Find
     90the line that lists the previous static IP address of the FQDN and
     91change it to the value "<userinput>0.0.0.0</userinput>".</para>
     92
    7293</sect2>
    7394
    7495</sect1>