mirror of
https://gitlab.isc.org/isc-projects/dhcp
synced 2025-08-31 06:15:55 +00:00
Add support for setting hostname
This commit is contained in:
@@ -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
|
||||
|
@@ -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.
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user