diff options
author | Bill Nottingham <notting@redhat.com> | 2010-01-11 16:14:09 -0500 |
---|---|---|
committer | Bill Nottingham <notting@redhat.com> | 2010-01-11 16:14:09 -0500 |
commit | 098087cbe4bd9dc4a5805eac15c3e86f1721ca43 (patch) | |
tree | 55c8f0270301eaf9f4ff97fd08099f0db65ced48 /sysconfig/network-scripts/ifup-eth | |
parent | 8e6447b4df30a77a005bf7d1ab6d91e2aca9bba9 (diff) | |
download | initscripts-098087cbe4bd9dc4a5805eac15c3e86f1721ca43.tar initscripts-098087cbe4bd9dc4a5805eac15c3e86f1721ca43.tar.gz initscripts-098087cbe4bd9dc4a5805eac15c3e86f1721ca43.tar.bz2 initscripts-098087cbe4bd9dc4a5805eac15c3e86f1721ca43.tar.xz initscripts-098087cbe4bd9dc4a5805eac15c3e86f1721ca43.zip |
dhclient's got a send-hostname option, use that
It certainly makes more sense than relying on the writing of temporary
config files in /etc. Use the same mechanism for IPv6 as well.
Diffstat (limited to 'sysconfig/network-scripts/ifup-eth')
-rwxr-xr-x | sysconfig/network-scripts/ifup-eth | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/sysconfig/network-scripts/ifup-eth b/sysconfig/network-scripts/ifup-eth index 2aead689..43d7ca3a 100755 --- a/sysconfig/network-scripts/ifup-eth +++ b/sysconfig/network-scripts/ifup-eth @@ -168,27 +168,11 @@ if [ -n "${BRIDGE}" -a -x /usr/sbin/brctl ]; then fi if [ -n "${DYNCONFIG}" -a -x /sbin/dhclient ]; then - # Remove any temporary references which were previously added to dhclient config - if [ -w /etc/dhclient-${DEVICE}.conf ] ; then - LC_ALL=C grep -v "# temporary RHL ifup addition" /etc/dhclient-${DEVICE}.conf > /etc/dhclient-${DEVICE}.conf.ifupnew 2> /dev/null - cat /etc/dhclient-${DEVICE}.conf.ifupnew > /etc/dhclient-${DEVICE}.conf - rm -f /etc/dhclient-${DEVICE}.conf.ifupnew - fi if [[ "${PERSISTENT_DHCLIENT}" = [yY1]* ]]; then ONESHOT=""; else ONESHOT="-1"; fi; - if [ -n "${DHCP_HOSTNAME}" ]; then - # Send a host-name to the DHCP server (requ. by some dhcp servers). - if [ -w /etc/dhclient-${DEVICE}.conf ] ; then - if ! LC_ALL=C grep "send *host-name *\"${DHCP_HOSTNAME}\"" /etc/dhclient-${DEVICE}.conf > /dev/null 2>&1 ; then - echo "send host-name \"${DHCP_HOSTNAME}\"; # temporary RHL ifup addition" >> /etc/dhclient-${DEVICE}.conf - fi - elif ! [ -e /etc/dhclient-${DEVICE}.conf ] ; then - echo "send host-name \"${DHCP_HOSTNAME}\"; # temporary RHL ifup addition" >> /etc/dhclient-${DEVICE}.conf - fi - fi # allow users to use generic '/etc/dhclient.conf' (as documented in manpage!) # if per-device file doesn't exist or is empty if [ -s /etc/dhclient-${DEVICE}.conf ]; then @@ -203,7 +187,7 @@ if [ -n "${DYNCONFIG}" -a -x /sbin/dhclient ]; then [ -x /sbin/restorecon ] && restorecon /var/lib/dhclient/dhclient-${DEVICE}.leases > /dev/null 2>&1 fi done - DHCLIENTARGS="${DHCLIENTARGS} ${ONESHOT} -q ${DHCLIENTCONF} -lf /var/lib/dhclient/dhclient-${DEVICE}.leases -pf /var/run/dhclient-${DEVICE}.pid" + DHCLIENTARGS="${DHCLIENTARGS} ${DHCP_HOSTNAME:+-H $DHCP_HOSTNAME} ${ONESHOT} -q ${DHCLIENTCONF} -lf /var/lib/dhclient/dhclient-${DEVICE}.leases -pf /var/run/dhclient-${DEVICE}.pid" echo echo -n $"Determining IP information for ${DEVICE}..." if [[ "${PERSISTENT_DHCLIENT}" != [yY1]* ]] && check_link_down ${DEVICE}; then @@ -306,7 +290,7 @@ fi # IPv6 initialisation? /etc/sysconfig/network-scripts/ifup-ipv6 ${CONFIG} if [[ "${DHCPV6C}" = [Yy1]* ]] && [ -x /sbin/dhclient ]; then - /sbin/dhclient -6 ${DHCPV6C_OPTIONS} ${DEVICE} -lf /var/lib/dhclient/dhclient6-${DEVICE}.leases -pf /var/run/dhclient6-${DEVICE}.pid + /sbin/dhclient -6 ${DHCPV6C_OPTIONS} -lf /var/lib/dhclient/dhclient6-${DEVICE}.leases -pf /var/run/dhclient6-${DEVICE}.pid ${DHCP_HOSTNAME:+-H $DHCP_HOSTNAME} ${DEVICE} fi if [ "${IPX}" = yes ]; then |