summaryrefslogtreecommitdiff
path: root/client/scripts
diff options
context:
space:
mode:
authorTed Lemon <source@isc.org>2000-05-01 17:17:25 +0000
committerTed Lemon <source@isc.org>2000-05-01 17:17:25 +0000
commit9f56e4372836458a27cd655254aff904fdaa44ba (patch)
treea4f62f3ff8b529212d2e87ea67a3639c609c135f /client/scripts
parent134ceef89f11188167d91c33f32a4cb2cae39ede (diff)
downloadisc-dhcp-9f56e4372836458a27cd655254aff904fdaa44ba.tar.gz
Fix setting of hostname.
Diffstat (limited to 'client/scripts')
-rwxr-xr-xclient/scripts/bsdos12
-rwxr-xr-xclient/scripts/freebsd8
-rwxr-xr-xclient/scripts/linux4
-rwxr-xr-xclient/scripts/netbsd5
-rw-r--r--client/scripts/nextstep15
-rw-r--r--client/scripts/openbsd12
-rwxr-xr-xclient/scripts/solaris9
7 files changed, 55 insertions, 10 deletions
diff --git a/client/scripts/bsdos b/client/scripts/bsdos
index d9e44b40..e6d0e2a0 100755
--- a/client/scripts/bsdos
+++ b/client/scripts/bsdos
@@ -72,12 +72,22 @@ 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$current_hostname = x ] || \
+ [ 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
route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
fi
- if [ x$old_ip_address != x ] && [ x$old_ip_address != x$new_ip_address ]; then
+ if [ x$old_ip_address != x ] && [ x$old_ip_address != x$new_ip_address ]
+ then
ifconfig $interface inet -alias $old_ip_address $medium
route delete $old_ip_address 127.1 >/dev/null 2>&1
for router in $old_routers; do
diff --git a/client/scripts/freebsd b/client/scripts/freebsd
index b3b73977..a095c12f 100755
--- a/client/scripts/freebsd
+++ b/client/scripts/freebsd
@@ -72,10 +72,11 @@ fi
if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \
[ x$reason = xREBIND ] || [ x$reason = xREBOOT ]; then
- current_hostname=`/bin/hostname`
+ 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
+ if [ x$current_hostname = x ] || \
+ [ x$new_host_name != x$old_host_name ]; then
hostname $new_host_name
fi
fi
@@ -84,7 +85,8 @@ if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \
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$old_ip_address != x ] && [ x$old_ip_address != x$new_ip_address ]; then
+ if [ x$old_ip_address != x ] && [ x$old_ip_address != x$new_ip_address ]
+ then
ifconfig $interface inet -alias $old_ip_address $medium
route delete $old_ip_address 127.1 >/dev/null 2>&1
for router in $old_routers; do
diff --git a/client/scripts/linux b/client/scripts/linux
index fc2756e5..603fff5b 100755
--- a/client/scripts/linux
+++ b/client/scripts/linux
@@ -99,10 +99,12 @@ if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \
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
+ if [ x$current_hostname = x ] || \
+ [ 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 d47841e2..bb8ffb8c 100755
--- a/client/scripts/netbsd
+++ b/client/scripts/netbsd
@@ -72,10 +72,11 @@ fi
if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \
[ x$reason = xREBIND ] || [ x$reason = xREBOOT ]; then
- current_hostname=`/bin/hostname`
+ 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
+ if [ x$current_hostname = x ] || \
+ [ x$new_host_name != x$old_host_name ]; then
hostname $new_host_name
fi
fi
diff --git a/client/scripts/nextstep b/client/scripts/nextstep
index 15623a38..1c8c2a26 100644
--- a/client/scripts/nextstep
+++ b/client/scripts/nextstep
@@ -13,8 +13,19 @@ if [ x$reason = xPREINIT ]; then
fi
if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \
[ x$reason = xREBIND ] || [ x$reason = xREBOOT ]; then
- if [ x$old_ip_address != x ] && [ x$old_ip_address != x$new_ip_address ]; then
- ifconfig $interface $new_ip_address netmask $new_subnet_mask >/dev/null 2>&1
+ current_hostname=`hostname`
+ if [ x$current_hostname = x ] || \
+ [ x$current_hostname = x$old_host_name ]; then
+ if [ x$current_hostname = x ] || \
+ [ x$new_host_name != x$old_host_name ]; then
+ hostname $new_host_name
+ fi
+ fi
+
+ if [ x$old_ip_address != x ] && [ x$old_ip_address != x$new_ip_address ]
+ then
+ ifconfig $interface $new_ip_address netmask $new_subnet_mask \
+ >/dev/null 2>&1
route add $new_ip_address 127.1 0 >/dev/null 2>&1
for router in $new_routers ; do
route add default $router 1 >/dev/null 2>&1
diff --git a/client/scripts/openbsd b/client/scripts/openbsd
index d9e44b40..e6d0e2a0 100644
--- a/client/scripts/openbsd
+++ b/client/scripts/openbsd
@@ -72,12 +72,22 @@ 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$current_hostname = x ] || \
+ [ 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
route delete $alias_ip_address 127.0.0.1 > /dev/null 2>&1
fi
- if [ x$old_ip_address != x ] && [ x$old_ip_address != x$new_ip_address ]; then
+ if [ x$old_ip_address != x ] && [ x$old_ip_address != x$new_ip_address ]
+ then
ifconfig $interface inet -alias $old_ip_address $medium
route delete $old_ip_address 127.1 >/dev/null 2>&1
for router in $old_routers; do
diff --git a/client/scripts/solaris b/client/scripts/solaris
index d60feeac..12a344c6 100755
--- a/client/scripts/solaris
+++ b/client/scripts/solaris
@@ -81,6 +81,15 @@ 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$current_hostname = x ] || \
+ [ 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}:1 inet 0 down > /dev/null 2>&1