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 a host-name option, s...



details:   https://anonhg.NetBSD.org/src/rev/69ac43ad1edc
branches:  trunk
changeset: 473453:69ac43ad1edc
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Fri Jun 04 20:12:52 1999 +0000

description:
If we get a host-name option, set it.

diffstat:

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

diffs (42 lines):

diff -r c401590cc481 -r 69ac43ad1edc usr.sbin/dhcp/client/scripts/netbsd
--- a/usr.sbin/dhcp/client/scripts/netbsd       Fri Jun 04 20:09:12 1999 +0000
+++ b/usr.sbin/dhcp/client/scripts/netbsd       Fri Jun 04 20:12:52 1999 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: netbsd,v 1.6 1999/03/05 22:37:43 mycroft Exp $
+# $NetBSD: netbsd,v 1.7 1999/06/04 20:12:52 thorpej Exp $
 
 make_resolv_conf() {
   echo search $new_domain_name >/etc/resolv.conf
@@ -30,6 +30,10 @@
   fi
 fi
 
+if [ x$new_host_name != x ]; then
+   echo New Host Name: $new_host_name
+fi
+
 if [ x$new_network_number != x ]; then
    echo New Network Number: $new_network_number
 fi
@@ -74,6 +78,9 @@
   
 if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \
    [ x$reason = xREBIND ] || [ x$reason = xREBOOT ]; then
+  if [ x$new_host_name != x ]; then
+    hostname $new_host_name
+  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
@@ -152,6 +159,9 @@
     ifconfig $interface inet -alias $alias_ip_address > /dev/null 2>&1
     route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
   fi
+  if [ x$new_host_name != x ]; then
+    hostname $new_host_name
+  fi
   ifconfig $interface inet $new_ip_address $new_netmask_arg \
                                        $new_broadcast_arg $medium
   sleep 1



Home | Main Index | Thread Index | Old Index