wit-network-config/files/dhcp-sethostname

9 lines
301 B
Plaintext
Raw Normal View History

2018-07-27 15:51:10 -05:00
if [ ! -z $new_host_name ]; then
hostname $new_host_name
echo $new_host_name >/etc/hostname
fi
if [ ! -z $new_domain_name ]; then
host_name=$(hostname)
sed -i "s/\([0-9]*\.[0-9]*\.[0-9]*\.[0-9]*\).*$host_name.*/\1 $host_name.${new_domain_name:-local} $host_name/" /etc/hosts
fi