Only invoke hostname(1) and domainname(1) if they exist (tested with the

`type' shell built-in).  Makes it possible to save some space on install
media which uses DHCP.
This commit is contained in:
thorpej 2000-04-28 16:34:31 +00:00
parent 99e6adf31e
commit f5fc764943

View File

@ -1,6 +1,6 @@
#!/bin/sh
#
# $NetBSD: netbsd,v 1.9 2000/04/22 08:18:13 mellon Exp $
# $NetBSD: netbsd,v 1.10 2000/04/28 16:34:31 thorpej Exp $
make_resolv_conf() {
echo search $new_domain_name >/etc/resolv.conf
@ -82,16 +82,20 @@ fi
if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \
[ x$reason = xREBIND ] || [ x$reason = xREBOOT ]; then
if type domainname > /dev/null 2>&1; then
if [ x$new_nis_domain != x ]; then
domainname $new_nis_domain
fi
current_hostname=`/bin/hostname`
fi
if type hostname > /dev/null 2>&1; then
current_hostname=`hostname`
if [ x$current_hostname = x ] || \
[ x$current_hostname = x$old_host_name ]; then
if [ x$new_host_name != x$old_host_name ]; then
hostname $new_host_name
fi
fi
fi
if [ x$old_ip_address != x ] && [ x$alias_ip_address != x ] && \
[ x$alias_ip_address != x$old_ip_address ]; then