aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig
diff options
context:
space:
mode:
authorLukas Nykryn <lnykryn@redhat.com>2015-04-09 16:09:37 +0200
committerLukas Nykryn <lnykryn@redhat.com>2015-12-15 14:28:46 +0100
commitcd475bf315b9c08e9f1732c0b9de95729025d1c5 (patch)
treeb88169dde4c7c2271084a4ee91ae811bca36618c /sysconfig
parent12ef0589a919867a2c925106fa114d3dbc4356b1 (diff)
downloadinitscripts-cd475bf315b9c08e9f1732c0b9de95729025d1c5.tar
initscripts-cd475bf315b9c08e9f1732c0b9de95729025d1c5.tar.gz
initscripts-cd475bf315b9c08e9f1732c0b9de95729025d1c5.tar.bz2
initscripts-cd475bf315b9c08e9f1732c0b9de95729025d1c5.tar.xz
initscripts-cd475bf315b9c08e9f1732c0b9de95729025d1c5.zip
network-functions: fix change_resolv_conf after grep update
Diffstat (limited to 'sysconfig')
-rwxr-xr-xsysconfig/network-scripts/ifup-eth4
-rw-r--r--sysconfig/network-scripts/network-functions2
2 files changed, 4 insertions, 2 deletions
diff --git a/sysconfig/network-scripts/ifup-eth b/sysconfig/network-scripts/ifup-eth
index e53683b7..97cff2d8 100755
--- a/sysconfig/network-scripts/ifup-eth
+++ b/sysconfig/network-scripts/ifup-eth
@@ -177,7 +177,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} ${DHCP_HOSTNAME:+-H $DHCP_HOSTNAME} ${ONESHOT} -q ${DHCLIENTCONF} -lf /var/lib/dhclient/dhclient-${DEVICE}.leases -pf /var/run/dhclient-${DEVICE}.pid"
+ DHCLIENTARGS="${DHCLIENTARGS} -H ${DHCP_HOSTNAME:-${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 +306,7 @@ if [[ "${DHCPV6C}" = [Yy1]* ]] && [ -x /sbin/dhclient ]; then
generate_config_file_name 6
echo
echo -n $"Determining IPv6 information for ${DEVICE}..."
- if /sbin/dhclient -6 -1 ${DHCPV6C_OPTIONS} ${DHCLIENTCONF} -lf /var/lib/dhclient/dhclient6-${DEVICE}.leases -pf /var/run/dhclient6-${DEVICE}.pid ${DHCP_HOSTNAME:+-H $DHCP_HOSTNAME} ${DEVICE} ; then
+ if /sbin/dhclient -6 -1 ${DHCPV6C_OPTIONS} ${DHCLIENTCONF} -lf /var/lib/dhclient/dhclient6-${DEVICE}.leases -pf /var/run/dhclient6-${DEVICE}.pid -H ${DHCP_HOSTNAME:-${HOSTNAME%%.*}} ${DEVICE} ; then
echo $" done."
else
echo $" failed."
diff --git a/sysconfig/network-scripts/network-functions b/sysconfig/network-scripts/network-functions
index 2a9bb811..2133b288 100644
--- a/sysconfig/network-scripts/network-functions
+++ b/sysconfig/network-scripts/network-functions
@@ -217,6 +217,8 @@ expand_config ()
i=$((i+1))
done
+ [ -n "$DHCP_HOSTNAME" ] && DHCP_HOSTNAME=${DHCP_HOSTNAME%%.*}
+
if [ -z "${NETWORK}" ]; then
eval $(/bin/ipcalc --network ${ipaddr[0]} ${netmask[0]})
fi