]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Add support for setting hostname
authorTed Lemon <source@isc.org>
Wed, 8 Sep 1999 01:42:34 +0000 (01:42 +0000)
committerTed Lemon <source@isc.org>
Wed, 8 Sep 1999 01:42:34 +0000 (01:42 +0000)
client/scripts/freebsd
client/scripts/linux
client/scripts/netbsd

index ce7a1bf25fbb2bd8972c6f3dca04a5b173053cc8..b3b739772c044169bef925e3cefdf4ce63886fe5 100755 (executable)
@@ -72,6 +72,13 @@ fi
   
 if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \
    [ x$reason = xREBIND ] || [ x$reason = xREBOOT ]; then
+  current_hostname=`/bin/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
   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
index a956bccf122fed2829669a0a0f7e803c1fbf5abe..fc2756e5a2f902a2165f98cd35f6535ea8222e72 100755 (executable)
@@ -96,6 +96,13 @@ fi
   
 if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \
    [ x$reason = xREBIND ] || [ x$reason = xREBOOT ]; 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
   if [ x$old_ip_address != x ] && [ x$alias_ip_address != x ] && \
                [ x$alias_ip_address != x$old_ip_address ]; then
     # Possible new alias. Remove old alias.
index 22697937079b069d0392c6d5fa0f6bc0220c328f..e6e04872978a4afd8d1fe7bfe3840b6174b4e2b7 100755 (executable)
@@ -72,6 +72,14 @@ fi
   
 if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \
    [ x$reason = xREBIND ] || [ x$reason = xREBOOT ]; then
+  current_hostname=`/bin/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
+    
   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