summaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>1999-08-04 05:34:33 +0000
committerobrien <obrien@FreeBSD.org>1999-08-04 05:34:33 +0000
commit83e5e22607eca479fb2ed7f788a962799cf9fd3b (patch)
treeee8d2a582a748cf96f652d95417a86963dc44389 /contrib
parent54b72818fb6a387f752eaac619145951eecebb66 (diff)
downloadFreeBSD-src-83e5e22607eca479fb2ed7f788a962799cf9fd3b.zip
FreeBSD-src-83e5e22607eca479fb2ed7f788a962799cf9fd3b.tar.gz
Support the setting of hostname via DHCP.
Submitted by: myself & Ted Lemon <mellon@isc.org>
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/isc-dhcp/client/scripts/freebsd7
1 files changed, 7 insertions, 0 deletions
diff --git a/contrib/isc-dhcp/client/scripts/freebsd b/contrib/isc-dhcp/client/scripts/freebsd
index ce7a1bf..b3b7397 100755
--- a/contrib/isc-dhcp/client/scripts/freebsd
+++ b/contrib/isc-dhcp/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
OpenPOWER on IntegriCloud