From: Ted Lemon Date: Wed, 8 Sep 1999 01:42:34 +0000 (+0000) Subject: Add support for setting hostname X-Git-Tag: V3-BETA-1-PATCH-2~5^2~132 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2cd9d72ce97415eb0c75b2a77d972db874e8d202;p=thirdparty%2Fdhcp.git Add support for setting hostname --- diff --git a/client/scripts/freebsd b/client/scripts/freebsd index ce7a1bf25..b3b739772 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 a956bccf1..fc2756e5a 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 226979370..e6e048729 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