Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/dhcp/client/scripts If we get an NIS domain name, s...



details:   https://anonhg.NetBSD.org/src/rev/283e17bbed2f
branches:  trunk
changeset: 473454:283e17bbed2f
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Fri Jun 04 20:40:50 1999 +0000

description:
If we get an NIS domain name, set it.  If we set, clear it when the
lease is released.

diffstat:

 usr.sbin/dhcp/client/scripts/netbsd |  16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diffs (53 lines):

diff -r 69ac43ad1edc -r 283e17bbed2f usr.sbin/dhcp/client/scripts/netbsd
--- a/usr.sbin/dhcp/client/scripts/netbsd       Fri Jun 04 20:12:52 1999 +0000
+++ b/usr.sbin/dhcp/client/scripts/netbsd       Fri Jun 04 20:40:50 1999 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: netbsd,v 1.7 1999/06/04 20:12:52 thorpej Exp $
+# $NetBSD: netbsd,v 1.8 1999/06/04 20:40:50 thorpej Exp $
 
 make_resolv_conf() {
   echo search $new_domain_name >/etc/resolv.conf
@@ -34,6 +34,10 @@
    echo New Host Name: $new_host_name
 fi
 
+if [ x$new_nis_domain != x ]; then
+   echo New NIS Domain: $new_nis_domain
+fi
+
 if [ x$new_network_number != x ]; then
    echo New Network Number: $new_network_number
 fi
@@ -81,6 +85,9 @@
   if [ x$new_host_name != x ]; then
     hostname $new_host_name
   fi
+  if [ x$new_nis_domain != x ]; then
+    domainname $new_nis_domain
+  fi
   if [ x$old_ip_address != x ] && [ x$alias_ip_address != x ] && \
                [ x$alias_ip_address != x$old_ip_address ]; then
     ifconfig $interface inet -alias $alias_ip_address > /dev/null 2>&1
@@ -127,6 +134,10 @@
 fi
 
 if [ x$reason = xEXPIRE ] || [ x$reason = xFAIL ]; then
+  if [ x$old_nis_domain != x ]; then
+    # delete the old nis domain name
+    domainname ""
+  fi
   if [ x$alias_ip_address != x ]; then
     ifconfig $interface inet -alias $alias_ip_address > /dev/null 2>&1
     route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
@@ -162,6 +173,9 @@
   if [ x$new_host_name != x ]; then
     hostname $new_host_name
   fi
+  if [ x$new_nis_domain != x ]; then
+    domainname $new_nis_domain
+  fi
   ifconfig $interface inet $new_ip_address $new_netmask_arg \
                                        $new_broadcast_arg $medium
   sleep 1



Home | Main Index | Thread Index | Old Index