aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2010-01-11 16:14:09 -0500
committerBill Nottingham <notting@redhat.com>2010-01-15 15:09:58 -0500
commitf55a93970eb372fbd44a181b68b46de854204e0c (patch)
tree7294e24cbac0834ccba6341de3ac2d7bc1164f07
parentedadc75528e1daaa2babdae5dfebdf33f7d06081 (diff)
downloadinitscripts-f55a93970eb372fbd44a181b68b46de854204e0c.tar
initscripts-f55a93970eb372fbd44a181b68b46de854204e0c.tar.gz
initscripts-f55a93970eb372fbd44a181b68b46de854204e0c.tar.bz2
initscripts-f55a93970eb372fbd44a181b68b46de854204e0c.tar.xz
initscripts-f55a93970eb372fbd44a181b68b46de854204e0c.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.
-rwxr-xr-xsysconfig/network-scripts/ifup-eth20
1 files changed, 2 insertions, 18 deletions
diff --git a/sysconfig/network-scripts/ifup-eth b/sysconfig/network-scripts/ifup-eth
index d3bb25b6..d9208c34 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
exec /etc/sysconfig/network-scripts/ifup-post ${CONFIG} ${2}