summaryrefslogtreecommitdiffstats
path: root/etc/rc.d/tmp
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2003-10-03 19:07:31 +0000
committerphk <phk@FreeBSD.org>2003-10-03 19:07:31 +0000
commited244490da876dba73de085e09056198b0d996e1 (patch)
treec54470e1d9c92b7fc767aeaba218e084c667661f /etc/rc.d/tmp
parent8db21048acb8baee76177793ef0f9d2e10abcf3f (diff)
downloadFreeBSD-src-ed244490da876dba73de085e09056198b0d996e1.zip
FreeBSD-src-ed244490da876dba73de085e09056198b0d996e1.tar.gz
More checking if kenv actually know something.
Guard against test(1)-unfriendly outputs from kenv.
Diffstat (limited to 'etc/rc.d/tmp')
-rw-r--r--etc/rc.d/tmp6
1 files changed, 4 insertions, 2 deletions
diff --git a/etc/rc.d/tmp b/etc/rc.d/tmp
index a244d71..6f189f2 100644
--- a/etc/rc.d/tmp
+++ b/etc/rc.d/tmp
@@ -145,7 +145,8 @@ fi
# generate our hostname
#
-if [ -z "`hostname -s`" ]; then
+if [ -z "`hostname -s`" -a \
+ "x`/bin/kenv dhdp.host-name`" != "x" ]; then
hostname=`/bin/kenv dhcp.host-name`
hostname $hostname
echo "Hostname is $hostname"
@@ -154,7 +155,8 @@ fi
# if the info is available via dhcp/kenv
# build the resolv.conf
#
-if [ ! -e /etc/resolv.conf -a `/bin/kenv dhcp.domain-name-servers` != "" ]; then
+if [ ! -e /etc/resolv.conf -a \
+ "x`/bin/kenv dhcp.domain-name-servers`" != "x" ]; then
echo domain `/bin/kenv dhcp.domain-name` > /etc/resolv.conf
set `/bin/kenv dhcp.domain-name-servers`
OpenPOWER on IntegriCloud