diff options
author | David Kaspar [Dee'Kej] <dkaspar@redhat.com> | 2017-05-02 23:17:19 +0200 |
---|---|---|
committer | Dee'Kej <deekej@linuxmail.org> | 2017-05-03 10:59:51 +0200 |
commit | cb7a84e8106398cd021237f41e7dd1e1e503c286 (patch) | |
tree | ee2407b7b0253f4e8c2807848244693b568a0125 /sysconfig/network-scripts/ifup-eth | |
parent | 4f8720706228d316e57ed95c3676e3478eb380fc (diff) | |
download | initscripts-cb7a84e8106398cd021237f41e7dd1e1e503c286.tar initscripts-cb7a84e8106398cd021237f41e7dd1e1e503c286.tar.gz initscripts-cb7a84e8106398cd021237f41e7dd1e1e503c286.tar.bz2 initscripts-cb7a84e8106398cd021237f41e7dd1e1e503c286.tar.xz initscripts-cb7a84e8106398cd021237f41e7dd1e1e503c286.zip |
DHCP_FQDN and DHCP_SEND_HOSTNAME introduced
The way DHCP_HOSTNAME is being sent to DHCP server has been completely
reworked...
DHCP_FQDN now allows user to specify fully qualified domain name to be
sent to DHCP server instead of just using simple hostname. This option
takes precedence before DHCP_HOSTNAME variable.
DHCP_SEND_HOSTNAME can be used to tell initscripts to not send either
DHCP_HOSTNAME or DHCP_FQDN to DHCP server.
Both of these options should behave same as they do in NetworkManager.
Diffstat (limited to 'sysconfig/network-scripts/ifup-eth')
-rwxr-xr-x | sysconfig/network-scripts/ifup-eth | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/sysconfig/network-scripts/ifup-eth b/sysconfig/network-scripts/ifup-eth index b6a883f6..3da5c16b 100755 --- a/sysconfig/network-scripts/ifup-eth +++ b/sysconfig/network-scripts/ifup-eth @@ -186,13 +186,9 @@ if [ -n "${DYNCONFIG}" ] && [ -x /sbin/dhclient ]; then generate_config_file_name generate_lease_file_name - if is_hostname_set; then - # We already have the hostname ->> send it to DHCP: - DHCLIENTARGS="${DHCLIENTARGS} -H ${DHCP_HOSTNAME:-${HOSTNAME%%.*}} ${ONESHOT} -q ${DHCLIENTCONF} -lf ${LEASEFILE} -pf /var/run/dhclient-${DEVICE}.pid" - else - # We need to acquire the hostname: - DHCLIENTARGS="${DHCLIENTARGS} ${DHCP_HOSTNAME:+-H $DHCP_HOSTNAME} ${ONESHOT} -q ${DHCLIENTCONF} -lf ${LEASEFILE} -pf /var/run/dhclient-${DEVICE}.pid" - fi + # Initialize the dhclient args and obtain the hostname options if needed: + DHCLIENTARGS="${DHCLIENTARGS} ${ONESHOT} -q ${DHCLIENTCONF} -lf ${LEASEFILE} -pf /var/run/dhclient-${DEVICE}.pid" + set_hostname_options DHCLIENTARGS echo echo -n $"Determining IP information for ${DEVICE}..." @@ -335,13 +331,9 @@ if is_true "${DHCPV6C}" && [ -x /sbin/dhclient ]; then echo echo -n $"Determining IPv6 information for ${DEVICE}..." - if is_hostname_set; then - # We already have the hostname ->> send it to DHCP: - DHCLIENTARGS="-6 -1 ${DHCPV6C_OPTIONS} ${DHCLIENTCONF} -lf ${LEASEFILE} -pf /var/run/dhclient6-${DEVICE}.pid -H ${DHCP_HOSTNAME:-${HOSTNAME%%.*}} ${DEVICE}" - else - # We need to acquire the hostname: - DHCLIENTARGS="-6 -1 ${DHCPV6C_OPTIONS} ${DHCLIENTCONF} -lf ${LEASEFILE} -pf /var/run/dhclient6-${DEVICE}.pid ${DHCP_HOSTNAME:+-H $DHCP_HOSTNAME} ${DEVICE}" - fi + # Initialize the dhclient args for IPv6 and obtain the hostname options if needed: + DHCLIENTARGS="-6 -1 ${DHCPV6C_OPTIONS} ${DHCLIENTCONF} -lf ${LEASEFILE} -pf /var/run/dhclient6-${DEVICE}.pid ${DEVICE}" + set_hostname_options DHCLIENTARGS if /sbin/dhclient $DHCLIENTARGS; then echo $" done." |