wit-network-config/files/dhcp-sethostname

6 lines
282 B
Plaintext
Raw Normal View History

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