summaryrefslogtreecommitdiff
path: root/client/scripts
diff options
context:
space:
mode:
authorTed Lemon <source@isc.org>1999-09-08 01:42:34 +0000
committerTed Lemon <source@isc.org>1999-09-08 01:42:34 +0000
commit2cd9d72ce97415eb0c75b2a77d972db874e8d202 (patch)
tree05e37b8c4d4899e7b067985521dda0d672f9ce08 /client/scripts
parentc5e75aab91c58ada4f40cc717425f667e16f8e97 (diff)
downloadisc-dhcp-2cd9d72ce97415eb0c75b2a77d972db874e8d202.tar.gz
Add support for setting hostname
Diffstat (limited to 'client/scripts')
-rwxr-xr-xclient/scripts/freebsd7
-rwxr-xr-xclient/scripts/linux7
-rwxr-xr-xclient/scripts/netbsd8
3 files changed, 22 insertions, 0 deletions
diff --git a/client/scripts/freebsd b/client/scripts/freebsd
index ce7a1bf2..b3b73977 100755
--- a/client/scripts/freebsd
+++ b/client/scripts/freebsd
@@ -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
diff --git a/client/scripts/linux b/client/scripts/linux
index a956bccf..fc2756e5 100755
--- a/client/scripts/linux
+++ b/client/scripts/linux
@@ -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.
diff --git a/client/scripts/netbsd b/client/scripts/netbsd
index 22697937..e6e04872 100755
--- a/client/scripts/netbsd
+++ b/client/scripts/netbsd
@@ -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