-# $OpenBSD: install.sub,v 1.762 2014/04/20 10:51:59 rpe Exp $
+# $OpenBSD: install.sub,v 1.763 2014/04/20 15:53:57 rpe Exp $
#
# Copyright (c) 1997-2009 Todd Miller, Theo de Raadt, Ken Westerback
# All rights reserved.
# no IP address assigned to $1.
#
# $1 == interface
-# $2 == hostname (optional).
+# $2 == hostname
dhcp_request() {
local _ifs=$1 _hn=$2
echo "lookup file bind" >/etc/resolv.conf.tail
- if [[ -n $_hn ]]; then
- _hn="send host-name \"$_hn\";"
- echo "Issuing hostname-associated DHCP request for $_ifs."
- else
- echo "Issuing free-roaming DHCP request for $_ifs."
- fi
-
cat >/etc/dhclient.conf <<__EOT
initial-interval 1;
-$_hn
+send host-name "$_hn";
request subnet-mask, broadcast-address, routers, domain-name,
domain-name-servers, host-name;
__EOT
none) ;;
dhcp) if [[ ! -x /sbin/dhclient ]]; then
echo "DHCP not possible - no /sbin/dhclient."
- elif dhcp_request $_ifs "$_name" || dhcp_request $_ifs; then
+ elif dhcp_request $_ifs "$_name"; then
echo "dhcp" >>$_hn
fi
;;