summaryrefslogtreecommitdiffstats
path: root/etc/rc.d
diff options
context:
space:
mode:
authoryar <yar@FreeBSD.org>2007-02-15 06:42:42 +0000
committeryar <yar@FreeBSD.org>2007-02-15 06:42:42 +0000
commit47a000e992cdc164b75e7b82e06041adfbf7a39f (patch)
treec0fc6e6f7528358c7b777cbb5e27aae5ac1e0ee7 /etc/rc.d
parent6449cfa01d3f6ff51bd43cb8dbd1163389c80e78 (diff)
downloadFreeBSD-src-47a000e992cdc164b75e7b82e06041adfbf7a39f.zip
FreeBSD-src-47a000e992cdc164b75e7b82e06041adfbf7a39f.tar.gz
Don't nag about unset $hostname if DHCP is in use.
Pointed out by: ceri
Diffstat (limited to 'etc/rc.d')
-rw-r--r--etc/rc.d/hostname7
1 files changed, 6 insertions, 1 deletions
diff --git a/etc/rc.d/hostname b/etc/rc.d/hostname
index a18b29c..f5fb643 100644
--- a/etc/rc.d/hostname
+++ b/etc/rc.d/hostname
@@ -31,6 +31,7 @@
# BEFORE: netif
. /etc/rc.subr
+. /etc/network.subr
name="hostname"
start_cmd="hostname_start"
@@ -61,7 +62,11 @@ hostname_start()
# Have we got a hostname yet?
#
if [ -z "${hostname}" ]; then
- warn "\$hostname is not set -- see ${rcvar_manpage}."
+ # Null hostname is probably OK if DHCP is in use.
+ #
+ if [ -z "`list_net_interfaces dhcp`" ]; then
+ warn "\$hostname is not set -- see ${rcvar_manpage}."
+ fi
return
fi
OpenPOWER on IntegriCloud